Allow null query comparands

I haven't tested this everywhere, but this change makes my code work.