Removed NanNewLocal. Some fixes and cleanup.