Proper fix for column counting in datatables sorting
Also fix reverse orderby mapping