Minor tweaks to upgrade script.