Delete unneeded copy of code
Fix bad behavior with ref to local var