Don't supply Kp1 to calc_x when we know it is zero. Also, Cn existing does not imply existence of Kp1.
Small fix for logging call.
Merge branch 'master' into logging