#1399: Use sorting function that maintains string indexes.