Fixed visibility check for objects