Added form key for Magento >= 1.8 compatibility + some bug fixes and improvements