Fix graph type check