Instead of using custom code here. Checked with 'meld' that the result is the same, except for problems that were already there (filed #26659).