rescaling fixup, major bug fixup in formlinesegment, cleanup required