Fixed calculation error for routing way points.