insertEffects: modified functions creating temporaries
insertEffects: correct compilation errors