Improved the handling of the search term