Metadata2

Fix a bug in writing metadata to a RecordSet.