Fix errors applying the patch