This class is unsafe. You cannot reuse an instance of it at two different nesting levels. The safeguarding of the old values should be done in `withScopedVars`.