Modified object serialization code