Fix the distance function.