Merge "Properly merge flags when merging transactions"