Code cleanup in search.cpp