Fixed issue in assigning duplicates.

Ref #24

Only the bugfix commit.