Fix lint error: undeclared var i

It looks like with the combination of #1190 and #1191 this variable got
undeclared by mistake.
Merge pull request #1199 from nylen/fix-missing-var-i

Fix lint error: undeclared var i