Merge pull request #231 from bastih/master

Clean up some more memory leaks.