Fixed a comparison operator to fix searchspecs caching.

Second fix for searchspecs caching. !$object may be true even if the object is valid.