Fixed "first" in loop codegen