Fixed some compatibility bugs