Allow permutation to return just one permutation.

fix gh-2158