Fixing unit test and integration test errors