Fix bug that creates unpredicted deletion when repeated items in list of indexes of elements to delete