fixed bug in bezier curves (thanks to DoctorGester)