Fix speed calculation.