fix error in curvature calculation (if there is no curve, you can't calculate curvature...)