Fix sorting for location_id