Fixed bug regarding upgrades not working