Fix the upgrade tool