Fix build breakages caused by inconsistent patching