Fixed bug in test for detecting duplicates