minor fixes to serialization and tests