Fix incorrect pruning in qsearch