Fix compatibility issues, make the tests pass