Fix subgraph generation.