Fix distance update