Fix unit and integration tests