Run tests on Travis and fix some compatibility issues