Fixed some compatibility problem.