Fixes Issue 9457 - isSorted(string) does not work.