Fixed typo in write_collection_begin.