Applied fix for issue #435 to the scoping mechanism.