many code tweaks, fixes, cleanups and simplifications around the curve rendering code.