Fixed bugs in integration tests