small code tweaks.
fixed side determination for curves.