Fixed bugs with MetadataDistance