Improvements to the merge script.