Removed global leaks

While testing this in LevelGraph I found these two global leaks. You might want to add a JSHint file to catch those.
Merge pull request #26 from mcollina/patch-1

Removed global leaks