Adding serialization bug fixes