Added visibility checks to ViewUtils.