Out-of-place patching