Add tests for serialization.