Fixed upgrade script [tracker 1950]