Fix Javascript error in MathEvent.js. #562