Fix crash on some snake tracks with dups

(range1 was null for all but the first iteration of the inner loop.)