fixes to visibility determination