Fixes for upgrade magic