Fix bug in router that led to mishandling of search terms.