Remove misplaced duplicates.