Fix graph collapse and expand