Fix serialization bug