Remove sortedIndex (not sure why it was there), fix gh-36.