Fix graph generation