Fix silly bug in object serialization