Fixed bug in control points algorithm