Move dist-upgrade to end of script