More fixes to the math matrix directive