Change Java serialization a little to be compatible with Python.