fixes prev_del/next_del when using server or thread sorting.