Various fixes and tweaks to search