Fixed up the search lib a bit