I can mathematically confirm these changes are correct- there are "n!" ways to order a list of "n" elements, however the original functionality would randomly pick one of "n^n" elements.
This necessarily would produce lopsided behavior, as n^n is not an integer multiple of n!, except in the case where n=0, 1, or 2 (where n^n is (effectively) 0, 1 and 4 respectively, and n! is (effectively) 0, 1 and 2 respectively), in all other cases, the "n is never divisible by n-1" rule comes into play and makes some permutations appear more often than others.
This appears to manifest as the 0th element of an array moving around significantly less often than other elements, which this PR fixes.