Fix error with generating multiple graphs.