Fix duplicates bug.