First fix in scan_merge: clone each inner graph independently
Merge pull request #1591 from lamblin/fix_scan_merge

Fix in scan_merge: clone each inner graph independently