minor fix to permutation