Changed the tag search. This hopefully speeds it up on larger systems.