Fix "Empty queries" not allowed in QL mode

Fixes #124 

As always please review carefully before applying. Thanks!