improved serialization tests