Added test for writing dynamic object.