Fixed a bug in qsearch