Added a bit more pruning to qsearch.