Fix bug when generating sublists of a list with size of one smaller