Fixed error handling when improper strings were passed in the search.