Fix bug in search.