ITS#9329 Re-fix merge_state

A bit uglier but more straightforward.
3 jobs for its9329b in 32 minutes and 19 seconds (queued for 1 minute and 40 seconds)