small bugfix;

Initiating new search by clicking a tag in reloaded detailview caused
exception.
bugfix;

removal of a random query caused exception if some of them were empty.