Error in trapezoidal integrator

Fixed a error on the trapezoidal integrator.