Fix distance issues