Visibility fixes and warnings cleanup