Fixed a bug with buying upgrades