Merge pull request #6 from arassadin/master

Memory leaks fix #1
Memory leaks fix #1 (some additions)