Fixes the miss by one search query bug.