Fix exceptions in CurveGenerator for mouse clicks and single, short
lines.