Added a bounds check in Permutations.nextPermutation() to prevent an
exception being thrown when given an input of size 0.