Return sane object when query is missing in text mode
Improved test suite