Fixes the inconsistency in the stats after update compared to upgrade

Using the same function to compute the upgrade in both cases guarantees
consistency