Simplify constant string concatenation
Fix inconsistent behavior when capturing the loop variable in foreach