Fixed trapezoidulation bugs