Fixed a severe integration error with logarithms