Introduced HandleScope to cleanup memory properly, fixed other minor
memory leaks
Use delete[] with new[]