debugging DMA: small error in set_moments and inconsistency in mathematical functions