Duplicate check

Fixes #13.