Fix unable to change case for search queries

Fix unable to change the case of a previously used search because of the
search history.