Fix duplicates bug

Ref #63