Fixed MathExpression bugs