Fixes #2629, by removing the no-longer-used sortedIndex