First code patching functions.