apply_patch(): fix new patch generation