Fixed some Android JNI bugs.