Fix bad class serialization