Code cleaning and optimization
MathMod - https://sourceforge.net/p/mathmod/tickets/2
Authored by: virtualmeet 2016-03-14
Parent: [r270]
Child: [r272]