Fixed an odd bug in the search function