improved serialization and deserialization tests, still not fully passing