issue #906 - fixed obvious error in MAD calculation and tests that expected the wrong answer