Add common patching functions