Improvements to math parser.