Correct legacy upgrade bugs.