Permutations to scalars and back again.