Fix unique producing duplicates