It looks like the merged segment is always named `seg_merged`.  Does this work when called repeatedly?