Fix bug involving multiple results with same priority