Patch merging