Fixing search comparison against nil