Fixing Android JNI bug