Another fix in get_nearest.