Fix Integral calculation