Fix a number of bugs when the integration takes place on a single interval