fix sorting of columns with undef values