Fix a bug where edge ids were not preserved during layout