Add merge codegen.
Fix grouping and action id selection.