More integration tests and some fixes.