Fix offset math.