Fix premature exit in upgrade routine #7