Add patch_control_file() function