Properly deallocation of memory.
Merge pull request #170 from murrekatt/develop

Properly deallocation of memory