Cleaned up some JNI errors