Add more checks to in_out_mathmode.py

Neurotic behaviour continues...