Guard against record corruption

 - The addMetadata call previously corrupted the record if called with no metadata to add