Fixed an issue with the duplicate detection

* It would fail on empty playlists