Attempt to fix apply_patch