Introduced HandleScope to cleanup memory properly, fixed other minor
memory leaks
Merge pull request #45 from miktam/bug/memory_leak_final

Introduced HandleScope to cleanup memory properly, fixed other minor