Fix: codes variable is leaked to global scope.

mocha will return with an error: "global leak detected: codes"
Merge pull request #155 from garyc40/master

Fix: codes variable is leaked to global scope