Various bugfixes introduced in my new search method