Fixed search bugs