Fix ambiguous order of upgrade instructions