Better serialization of enum types.