More work on the upgrades system. Now works as intended.