Fixes to the edge case  after merging the graphs