Fix issues with upgrade.