complete integration tests and small fixes