Fixed bug in collision math.