Fixed a couple of calculations