Optimizations; fix off-by-one in track counting.