Fixed haywire upgrade bug