Fixed a bit of the math.