Changed sqimap_get_sort_order call to take three variables