Fixed sorting issues on some grids