Correctly passes objects to JNIEnv