A little bit of clean up
Fix broken computation of duplicates