added tests for correct serialization