Fix global leaks
Merge pull request #245 from syrnick/master

Fix global leaks
Merge remote-tracking branch 'remotes/zaach-original/master'