Improvements to table sorting.