Fix graph creation