Fix calculation of distance between clients