Small fix for fillDistanceArray()