Fixed global leaks
Merge pull request #4 from sunesimonsen/patch-1

Fixed global leaks