Fixing search bugs