Added conditions for mi_tag in sum calculations.