Added a couple tests, added scope checking.