Fix distance error partially.