Fix upgrade script.