Bug fixes for search