Minor fixes to search. Doesn't really fix the problem yet.