Fix issue #40: support for shared scope