Various PD fixes

Various corrections and minor refinements to the "PD" programs.