Corrects upgrade routine.