BezierCurve: Fix segfault issue