Bugfixes with handling of visibilty.