Fixed calculation of cookie-type upgrades