Remove old upgrade script and cleanup linefeed in new upgrade function