Fixed a few memory leaks.
Merge pull request #5 from JohannesLorenz/master

Fixed a few memory leaks.