few tweaks to math templates