JSlint errors.

Some errors due to 'for (var i' were displayed by jsLint.