Fix calculation of extremities for bezier curves.