Changed serialization and deserialization of objects