Global leak detected: i

Got mocha error because of the missing 'var' statement
Merge pull request #516 from mike-zenith/patch-2

Global leak detected: i