The influence of benzylic protection and allylic substituents on the CuCl-TMEDA catalyzed rearrangement of N-allyl-N-benzyl-2,2-dihaloamides to gamma-lactams. Application to the stereoselective synthesis of pilolactam.