CurveTracer: Fix bug with array indexes