integration test and fixes