Fixed more errors and made upgrades work again