Fix: mathops internal parsing bug

Credits to Jayesh Nambiar for reporting
(cherry picked from commit aeddd311d29c9d5cae5017bd59674031089b5574)