Added more graceful error handling for an exception occurring in contour ordering code.

Not sure where this problem is coming from, however it is an intermittent problem and I don't have a reproduceable test case yet. As of now, the tool continues to work seemingly without problems, so I'm not sure if this deserves more attention or not...