Fix index bug in short_sort().