Fix some compatibility issues.