Cleanup MathX functions.
Minor amendments.