Fixes for the upgrade process