Fixes for re-writing PATCHES.txt.