fix some compatibility problems