Fixing visibility detection.