Fix memory leaks
Merge pull request #31 from yamakiyo/master

Fix memory leaks