Added unit test for serialization