Fix an epic bug with the search ordering