Fix a serialization issue with NativeCall on JVM.