Fixed error in dE calculation.