Fixed so that an empty list does not crash the check of unique items.