Fixed list indexing in closed spline curve