Fixed bugs in cubic spline interpolation and smooth path generation