Fix graph re-ordering