diff --git a/src/Controller/SwitchUserController.php b/src/Controller/SwitchUserController.php
index 7caaaef..0e981c3 100644
--- a/src/Controller/SwitchUserController.php
+++ b/src/Controller/SwitchUserController.php
@@ -99,7 +99,7 @@ class SwitchUserController extends ControllerBase {
    * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
    */
   public function switchUser($name = NULL) {
-    if (empty($name) || (!$account = $this->userStorage->loadByProperties(['name' => $name]))) {
+    if (empty($name) || !($account = $this->userStorage->loadByProperties(['name' => $name]))) {
       throw new AccessDeniedHttpException();
     }
     $account = reset($account);
diff --git a/src/Form/SwitchUserForm.php b/src/Form/SwitchUserForm.php
index c5b199b..a7e8985 100644
--- a/src/Form/SwitchUserForm.php
+++ b/src/Form/SwitchUserForm.php
@@ -90,10 +90,10 @@ class SwitchUserForm extends FormBase {
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
     if (!$account = User::load($form_state->getValue('userid'))) {
-      $form_state->setErrorByName('username', t('Username not found'));
+      $form_state->setErrorByName('userid', t('Username not found'));
     }
     else {
-      $form_state->setValue('username', $account->getUsername());
+      $form_state->setValue('userid', $account->getUsername());
     }
   }
 
