Small fix for d_phi function.