Fix bugs related to MathJax formatting.