Fix handling of nil in query-seqs