Fixed some search bugs