Spline Mesh glitches

I never have this problem if I stick to the simple code: