Fix up ellipse arc approximation.

The previous version could blow the stack.