Fixed numerous search bugs