Serialization in the base class.