serialization, some fixes