Fixed upgrade script.