Fix typo in format() as well as handling of D == 0 for Np.