Added test for scope issue #138