Fix memory leaks
Remove unrelated code
Merge pull request #74 from tdukart/master

Fix memory leaks