Fix some twisting errors (better clamping, correct derivative); fewer quadrature points per segment.