Fix upgrade issues