Updated uses of auto in loops.