Changed value of "tangent" at corners to average.