Fix shader system

Also some minor fixes in BezierCurve class