Safer patching