Polymorphic serialization and de-serialization.

Fixed.