Merging some forks to be compatible with magento 1.8