A bit of consistency in variable naming.
Fixed a slice generation error on small segments that close a loop.