Improved error checking so that it can catch degenerate arcs as well as lines.
Removed unused code.