A few small fixes to the calculation of dispersion.