Consider the following code (or see first attachment):
The second call to Execute(scope1) fails with NullReferenceException. When I make variable i global ($i), there is no exception, if I use no custom scope there is no exception.
The bug occurs even if I do not use Dictionary to initilize the scope.
Stack trace is: