POD-2998 fix for overflowing math blocks