Fix graph handling