Fixed permutations

I had actually implemented the inverse of the permutation
behaviour that I really wanted. It's fixed now.