Upgrades and bug fixies