Fix test variable name for angle
Add rotation support for the segment and other various fixes to the segment