Detect duplicates and mark them.