Add test for serialization