Tweak parent relationships in metadata to make them consistent