patch sorting predicates, so that all columns work

This repairs sorting. to be merged before #56 :)