fix for degenerated lines (less than 2 points), fixes #2