Fixed NullPointerException when performing searches.