Fix regression in using visibility flags. 
6 files changed