Fix graph reduction tool