Fix extra deletes to local references on JNI side. Remove an extra object copy.
Fixed 1 small memory leak.