Updated merge script