Fix minor logic error with visibility