access mode correctly set/restored for nested classes