Adapted code to MetadataRecord interface changes