Fixed fillCubicCurve function