scope fix, updated tests