added some more assertions to integration tests, discovered and fixed 2 bugs.