Fixes for upgrade