Added some compatibility improvements and changes