Added Session.is_at_top_level.