Fix notice on default_sort. Use the sort helper function