fix for #15
add scoping tests, closes #16