Trivial log statement fixes.
Reimplement permutation() leveraging STL more.