Fixed upgrade issues