Fix some compatibility issue.