Fix upgrade crashes
Fix scaffold crashes