Fixed wrong distances and bearing math.