Added more assertions to define assumptions better.
Cleaned up tests
Final commit