Fix upgrade detection