Fixed calculation of m_upgradeexp