Fixed row sort bug