Fixed duplicate use of variable i
p4#: 22361