fix bugs in integration tests