diff --git a/cas.module b/cas.module
index ef46ee3..3672d93 100644
--- a/cas.module
+++ b/cas.module
@@ -877,17 +877,10 @@ function cas_form_alter(&$form, &$form_state, $form_id) {
           // The user is not an administrator, so selectively remove the e-mail
           // and password fields.
           if (variable_get('cas_hide_email', 0)) {
-            // We cannot just unset mail, as then the form throws an error.
-            // Also, we have to provide a reasonable default as otherwise there
-            // will be a validation errors.
-            $form['account']['mail']['#type'] = 'hidden';
-            $form['account']['mail']['#value'] = $form['account']['mail']['#default_value'];
-            if (!$form['account']['mail']['#default_value']) {
-              $form['account']['mail']['#value'] = $form['_account']['#value']->name . '@' . variable_get('cas_domain', '');
-            }
+            $form['account']['mail']['#access'] = FALSE;
           }
           if (variable_get('cas_hide_password', 0)) {
-            unset($form['account']['pass']);
+            $form['account']['pass']['#access'] = FALSE;
           }
         }
       }
