Ensured class instances are serializable