Mathematica cleanup