Bug in upgrade script reported by dlglin