Add handling of missing distances