Improve testing for proper scopes