Sort indexes for predictable ordering.