Fix table sort order