More integration tests.
Fix bug.