fix sorting of undefined values with multiple columns