Fix upgrade routine