integration tests and fixes