Dpc more

More issues related to dpc code are resolved.
I would do this with a mask that everything but the diagonal rather than testing if the values are 0 (three times!).