Made the tests pass and making them self-contained
Merge branch 'selfcontained_tests'