diff --git a/core/authorize.php b/core/authorize.php
index 4752799..073770a 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -21,6 +21,7 @@
  */
 
 use Drupal\Core\DrupalKernel;
+use Drupal\Core\Form\EnforcedResponseException;
 use Drupal\Core\Url;
 use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -169,7 +170,13 @@ function authorize_access_allowed(Request $request) {
     }
     elseif (!$batch = batch_get()) {
       // We have a batch to process, show the filetransfer form.
-      $content = \Drupal::formBuilder()->getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm');
+      try {
+        $content = \Drupal::formBuilder()->getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm');
+      }
+      catch (EnforcedResponseException $e) {
+        $e->getResponse()->send();
+        exit;
+      }
     }
   }
   // We defer the display of messages until all operations are done.
diff --git a/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php b/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
index cb4cae2..3d95cc8 100644
--- a/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
+++ b/core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php
@@ -214,10 +214,12 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
               $connection_settings[$key] = $value;
             }
           }
-          // Set this one as the default authorize method.
-          $this->config('system.authorize')->set('filetransfer_default', $filetransfer_backend);
-          // Save the connection settings minus the password.
-          $this->config('system.authorize')->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings);
+          // Set this one as the default authorize method and
+          // save the connection settings minus the password.
+          $this->configFactory()->getEditable('system.authorize')
+            ->set('filetransfer_default', $filetransfer_backend)
+            ->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings)
+            ->save();
 
           $filetransfer = $this->getFiletransfer($filetransfer_backend, $form_connection_settings[$filetransfer_backend]);
 
@@ -342,7 +344,7 @@ protected function runOperation($filetransfer) {
     $operation = $_SESSION['authorize_operation'];
     unset($_SESSION['authorize_operation']);
 
-    require_once $this->root . '/' . $operation['file'];
+    require_once $operation['file'];
     return call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments']));
   }
 
