Improve math normalization

Related to #741