Fix some search bugs