Add test for serialize()