More fixes to calculations.
Fix some numerical bugs caused by forgetting that '1' translates to '0' on the x axis in log scale.