Fix bugs in integration tests.