Serialization bug fix