Fixed few memory leaks
Introduced HandleScope to cleanup memory properly