Fixes in integral calculation.