serialization bug fixes