Detect and correct line-segments

Also fixes an issue with cull-cost calculation when line segments are
used