Improved some of the generic line trace functions