Fix mishandle of visibility modifiers