Reduce scope of loop variables.