diff --git a/rsapublickey/rsapublickey.module b/rsapublickey/rsapublickey.module
index 2d9a15a..7653943 100644
--- a/rsapublickey/rsapublickey.module
+++ b/rsapublickey/rsapublickey.module
@@ -1,5 +1,4 @@
 <?php
-// $Id:  $
 
 /**
  * @file
@@ -62,7 +61,6 @@ function rsapublickey_field_schema($field) {
         ),
       );
       break;
-
   }
   return array(
     'columns' => $columns,
@@ -97,7 +95,6 @@ function rsapublickey_field_formatter_info() {
 function rsapublickey_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
   $element = array();
   $settings = $display['settings'];
-
   switch ($display['type']) {
     case 'rsapublickey':
       foreach ($items as $delta => $item) {
@@ -113,12 +110,10 @@ function rsapublickey_field_formatter_view($entity_type, $entity, $field, $insta
         $output .= '    </div>';
         $output .= '  </div>';
         $output .= '</div>';
-
         $element[$delta] = array('#markup' => $output);
       }
       break;
   }
-
   return $element;
 }
 
@@ -148,6 +143,5 @@ function rsapublickey_field_widget_form(&$form, &$form_state, $field, $instance,
     '#default_value' => isset($items[$delta]['exponent']) ? $items[$delta]['exponent'] : '',
     '#title' => t('Exponent'),
   );
-
   return $element;
 }
diff --git a/rsapublickey/rsapublickey.test b/rsapublickey/rsapublickey.test
index 68a8710..42c2133 100644
--- a/rsapublickey/rsapublickey.test
+++ b/rsapublickey/rsapublickey.test
@@ -1,5 +1,8 @@
 <?php
-// $Id:  $
+/**
+ * @file
+ * Test RSA public key fields and widgets
+ */
 
 class RsapublickeyFieldTestCase extends DrupalWebTestCase {
   protected $instance;
diff --git a/webidauth.info b/webidauth.info
index dab2773..22500ee 100644
--- a/webidauth.info
+++ b/webidauth.info
@@ -4,3 +4,5 @@ package = Authentication
 core = 7.x
 dependencies[] = libraries
 configure = admin/config/people/webidauth
+files[] = webidauth.module
+
diff --git a/webidauth.install b/webidauth.install
index ea7325b..f6bdf45 100644
--- a/webidauth.install
+++ b/webidauth.install
@@ -17,68 +17,55 @@
 
 /**
  * webidauth_schema()
- * Implements hook_schema()
+ * Implements hook_schema().
  */
 function webidauth_schema() {
-
-   $schema['webidauth'] = array(
-      'description' => 'Stores the asociations between users and WebIDs.' ,
-      'fields' => array(
-      	'wid' => array(
-            'type' => 'serial',
-            'not null' => TRUE,
-            'description' => 'Primary key: Unique identifier for a WebID asociation',
-      	  ),
-         'uri' => array(
-            'type' => 'varchar',
-            'length' => 5000,
-            'not null' => TRUE,
-            'description' => 'A universal resource identifier pointing to user\'s
-                              foaf profile',
-           ),
-
-         'uid' => array(
-            'type' => 'int',
-            'not null' => TRUE,
-            'description' => 'The uid of the user asociated with the WebID',
-           ),
-
+  $schema['webidauth'] = array(
+    'description' => 'Stores the asociations between users and WebIDs.' ,
+    'fields' => array(
+      'wid' => array(
+        'type' => 'serial',
+        'not null' => TRUE,
+        'description' => 'Primary key: Unique identifier for a WebID asociation',
       ),
-      'primary key' => array('wid'),
-
-
-
-
-   );
-
+      'uri' => array(
+        'type' => 'varchar',
+        'length' => 5000,
+        'not null' => TRUE,
+        'description' => 'A universal resource identifier pointing to user\'s foaf profile',
+      ),
+      'uid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'description' => 'The uid of the user asociated with the WebID',
+      ),
+    ),
+    'primary key' => array('wid'),
+  );
   return $schema;
 }
 
-
 /**
-* Implements hook_install().
-*/
+ * Implements hook_install().
+ */
 function webidauth_install() {
   drupal_set_message(st("Webidauth settings are available under !link",
-    array( '!link' => l('Configuration > People > WebID settings ',  'admin/config/people/webidauth' ) )
+    array( '!link' => l('Configuration > People > WebID settings ', 'admin/config/people/webidauth' ) )
   ));
 }
 
-
 /**
  * Implements hook_requirements().
  */
 function webidauth_requirements($phase) {
   $requirements = array();
-
   if ($phase == 'runtime') {
-
     if (!class_exists('Authentication_FoafSSLDelegate')) {
       $requirements['webid_libAuthentication'] = array(
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@libauth">libAuthentication library</a>.', array('@libauth' => 'https://github.com/WebIDauth/libAuthentication')),
-        'title'=>t('libAuthentication library')
+        'title' => t('libAuthentication library')
       );
     }
     if (!class_exists('ARC2')) {
@@ -86,7 +73,7 @@ function webidauth_requirements($phase) {
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@arc">ARC library</a>.', array('@arc' => 'https://github.com/semsol/arc2/')),
-        'title'=>t('ARC library')
+        'title' => t('ARC library')
       );
     }
     if (!class_exists('Graphite')) {
@@ -94,21 +81,14 @@ function webidauth_requirements($phase) {
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@graphite">Graphite RDF library</a>.', array('@graphite' => 'http://graphite.ecs.soton.ac.uk/')),
-        'title'=>t('Graphite RDF library')
+        'title' => t('Graphite RDF library')
       );
     }
-
   }
-
   return $requirements;
 }
 
-
-
-
-
-function webidauth_update_7100(){
-   db_drop_field('webidauth','modulus');
-   return 'Removed redundant modulus field';
-
+function webidauth_update_7100() {
+  db_drop_field('webidauth', 'modulus');
+  return 'Removed redundant modulus field';
 }
diff --git a/webidauth.module b/webidauth.module
index 59450c6..17f06b9 100644
--- a/webidauth.module
+++ b/webidauth.module
@@ -38,258 +38,230 @@ d6CzYQZag+/xiMVzDmKG19pI2WSrt7BlN10=
 
 
 if (module_exists('libraries')) {
-    if (!defined('RDF_ARC2_PATH'))define('RDF_ARC2_PATH', libraries_get_path('ARC2') . '/arc');
-    if (!defined('GRAPHITE_RDF_PATH'))define('GRAPHITE_RDF_PATH', libraries_get_path('Graphite'));
-    if (!defined('AUTHENTICATION_LIBRARY_PATH'))define('AUTHENTICATION_LIBRARY_PATH', libraries_get_path('libAuthentication'));
+  if (!defined('RDF_ARC2_PATH'))define('RDF_ARC2_PATH', libraries_get_path('ARC2') . '/arc');
+  if (!defined('GRAPHITE_RDF_PATH'))define('GRAPHITE_RDF_PATH', libraries_get_path('Graphite'));
+  if (!defined('AUTHENTICATION_LIBRARY_PATH'))define('AUTHENTICATION_LIBRARY_PATH', libraries_get_path('libAuthentication'));
 }
 if (!class_exists('ARC2')) {
-    @include_once RDF_ARC2_PATH . '/ARC2.php';
-    if (!class_exists('Graphite')) {
-        @include_once GRAPHITE_RDF_PATH . '/Graphite.php';
-    }
+  @include_once RDF_ARC2_PATH . '/ARC2.php';
+  if (!class_exists('Graphite')) {
+    @include_once GRAPHITE_RDF_PATH . '/Graphite.php';
+  }
 }
 if (!class_exists('Authentication_FoafSSLDelegate') && file_exists(AUTHENTICATION_LIBRARY_PATH .
-        '/lib/Authentication.php')) {
-        @include_once AUTHENTICATION_LIBRARY_PATH . '/lib/Authentication.php';
+  '/lib/Authentication.php')) {
+  @include_once AUTHENTICATION_LIBRARY_PATH . '/lib/Authentication.php';
 }
 //Include the WebID foaf parser
 module_load_include('inc', 'webidauth', 'webidauth.parser');
 
-
 /**
- * Implements hook_menu()
+ * Implements hook_menu().
  */
 function webidauth_menu() {
-    $items['user/%user/webidauth'] = array('title' => 'WebID identities',
-        'page callback' => 'webidauth_user_identities', 'page arguments' => array(1),
-        'access callback' => '_webid_auth_access', 'access arguments' => array(1), 'type' =>
-        MENU_LOCAL_TASK, 'file' => 'webidauth.pages.inc', );
-    $items['user/%user/webidauth/delete'] = array('title' => 'Delete WebID',
-        'page callback' => 'drupal_get_form', 'page arguments' => array('webidauth_user_delete_form',
-        1), 'access callback' => '_webid_auth_access', 'access arguments' => array(1),
-        'file' => 'webidauth.pages.inc', );
-    $items['user/%user/webidauth/add'] = array('title' => 'WebID add',
-        'page callback' => 'webidauth_add_page', 'access callback' => '_webid_auth_access',
-        'type' => MENU_CALLBACK, 'file' => 'webidauth.pages.inc', 'access arguments' =>
-        array(1), 'page arguments' => array(1), );
-    $items['admin/config/people/webidauth'] = array('title' => 'WebID settings',
-        'description' => 'Configure how users are authenticated by WebID.',
-        'page callback' => 'drupal_get_form', 'page arguments' => array('webidauth_admin'),
-        'access arguments' => array('access administration pages', 'configure webidauth'), 'type' =>
-        MENU_NORMAL_ITEM, );
-    $items['webidauth/authenticate'] = array('title' => 'WebID Login',
-        'page callback' => 'webidauth_authentication_page', 'access callback' =>
-        'user_is_anonymous', 'type' => MENU_CALLBACK, 'file' => 'webidauth.pages.inc', );
-    return $items;
+  $items['user/%user/webidauth'] = array('title' => 'WebID identities',
+    'page callback' => 'webidauth_user_identities', 'page arguments' => array(1),
+    'access callback' => '_webid_auth_access', 'access arguments' => array(1), 'type' =>
+    MENU_LOCAL_TASK, 'file' => 'webidauth.pages.inc', );
+  $items['user/%user/webidauth/delete'] = array('title' => 'Delete WebID',
+    'page callback' => 'drupal_get_form', 'page arguments' => array('webidauth_user_delete_form',
+    1), 'access callback' => '_webid_auth_access', 'access arguments' => array(1),
+    'file' => 'webidauth.pages.inc', );
+  $items['user/%user/webidauth/add'] = array('title' => 'WebID add',
+    'page callback' => 'webidauth_add_page', 'access callback' => '_webid_auth_access',
+    'type' => MENU_CALLBACK, 'file' => 'webidauth.pages.inc', 'access arguments' =>
+    array(1), 'page arguments' => array(1), );
+  $items['admin/config/people/webidauth'] = array('title' => 'WebID settings',
+    'description' => 'Configure how users are authenticated by WebID.',
+    'page callback' => 'drupal_get_form', 'page arguments' => array('webidauth_admin'),
+    'access arguments' => array('access administration pages', 'configure webidauth'), 'type' =>
+    MENU_NORMAL_ITEM, );
+  $items['webidauth/authenticate'] = array('title' => 'WebID Login',
+    'page callback' => 'webidauth_authentication_page', 'access callback' =>
+    'user_is_anonymous', 'type' => MENU_CALLBACK, 'file' => 'webidauth.pages.inc', );
+  return $items;
 }
 
-
 function _webid_auth_access($uid_arg) {
-
-    global $user;
-    if ($uid_arg->uid === $user->uid)
-        return TRUE;
-    else
-      if(isset($uid_arg->uid) && isset($user->uid))
-        return user_access('modify webidauth identities') && user_edit_access($uid_arg);
-      else return false;
-
-
+  global $user;
+  if ($uid_arg->uid === $user->uid)
+    return TRUE;
+  else
+    if (isset($uid_arg->uid) && isset($user->uid))
+      return user_access('modify webidauth identities') && user_edit_access($uid_arg);
+    else return FALSE;
 }
 
-
-
 /**
  * Implements hook_menu_site_status_alter().
+ * Allow access to webid/authenticate even if site is in offline mode.
  */
 function webidauth_menu_site_status_alter(&$menu_site_status, $path) {
-    // Allow access to webid/authenticate even if site is in offline mode.
-    if ($menu_site_status == MENU_SITE_OFFLINE && user_is_anonymous() && $path ==
-        'webidauth/authenticate') {
-        $menu_site_status = MENU_SITE_ONLINE;
-    }
+  if ($menu_site_status == MENU_SITE_OFFLINE && user_is_anonymous() && $path ==
+    'webidauth/authenticate') {
+    $menu_site_status = MENU_SITE_ONLINE;
+  }
 }
 
 /**
  * Implements hook_admin_paths().
  */
 function webidauth_admin_paths() {
-    $paths = array('user/*/webidauth' => TRUE, 'user/*/webidauth/delete' => TRUE,
-        'admin/config/people/webidauth', );
-    return $paths;
+  $paths = array('user/*/webidauth' => TRUE, 'user/*/webidauth/delete' => TRUE,
+    'admin/config/people/webidauth', );
+  return $paths;
 }
 
 /**
  * Implements hook_help().
  */
 function webidauth_help($path, $arg) {
-    switch ($path) {
-        case 'user/%/webidauth':
-            $output = '<p>' . t('This site supports <a href="@webid-net">WebID</a>, a secure way to log in to many websites using a single client-certificate. WebID can reduce the necessity of managing many usernames and passwords for many websites.',
-                array('@webid-net' => 'http://www.w3.org/2005/Incubator/webid/spec/')) . '</p>';
-            $output .= '<p>' . t('To use WebID you must first establish an identity on a public or private WebID server.')
-                . '</p>';
-            $output .= '<p>' . t('If you already have an WebID, enter the URL to your WebID foaf-profile below (e.g. http://webid.fcns.eu/people/yourname/foaf.txt#me). Next time you log in, you will be able to use the certificate installed in your browser instead of a regular username and password. You can have multiple WebID identities if you like; just keep adding them here.') .
-                '</p>';
-            return $output;
-        case 'admin/help#webidauth':
-            $output = '';
-            $output .= '<h3>' . t('About') . '</h3>';
-            $output .= '<p>' . t('The WebID module allows users to log in using the WebID single sign on service. <a href="@webid-net">WebID</a> is a secure method for logging into many websites with a single client certificate, installed in their browsers. It does not share passwords with any site to which it is associated, including the site being logged into. The main benefit to users is that they can have a single certificate that they can use on many websites. For more information, see the online handbook entry for <a href="@handbook">WebID module</a>.',
-                array('@webid-net' => 'http://www.w3.org/2005/Incubator/webid/spec/', '@handbook' =>
-                'http://drupal.org/handbook/modules/webidauth')) . '</p>';
-            $output .= '<h3>' . t('Uses') . '</h3>';
-            $output .= '<dl>';
-            $output .= '<dt>' . t('Logging in with WebID') . '</dt>';
-            $output .= '<dd>' . t("To log in using WebID, a user must already have an WebID certificate. Users can then create site accounts using their WebID, assign one or more WebIDs to an existing account, and log in using an WebID. This lowers the barrier to registration, which helps increase the user base, and offers convenience and security to the users. Because WebID cannot guarantee a user is legitimate, email verification is still necessary. When logging in, users are presented with a browser dialog window to select their WebID certificate. The site then communicates with the WebID server, asking it to verify the identity of the user. If the user is logged into their WebID server, the server communicates back to your site, verifying the user.") .
-                '</dd>';
-            $output .= '</dl>';
-            return $output;
-    }
+  switch ($path) {
+    case 'user/%/webidauth':
+      $output = '<p>' . t('This site supports <a href="@webid-net">WebID</a>, a secure way to log in to many websites using a single client-certificate. WebID can reduce the necessity of managing many usernames and passwords for many websites.',
+        array('@webid-net' => 'http://www.w3.org/2005/Incubator/webid/spec/')) . '</p>';
+      $output .= '<p>' . t('To use WebID you must first establish an identity on a public or private WebID server.')
+        . '</p>';
+      $output .= '<p>' . t('If you already have an WebID, enter the URL to your WebID foaf-profile below (e.g. http://webid.fcns.eu/people/yourname/foaf.txt#me). Next time you log in, you will be able to use the certificate installed in your browser instead of a regular username and password. You can have multiple WebID identities if you like; just keep adding them here.') .
+        '</p>';
+      return $output;
+    case 'admin/help#webidauth':
+      $output = '';
+      $output .= '<h3>' . t('About') . '</h3>';
+      $output .= '<p>' . t('The WebID module allows users to log in using the WebID single sign on service. <a href="@webid-net">WebID</a> is a secure method for logging into many websites with a single client certificate, installed in their browsers. It does not share passwords with any site to which it is associated, including the site being logged into. The main benefit to users is that they can have a single certificate that they can use on many websites. For more information, see the online handbook entry for <a href="@handbook">WebID module</a>.',
+        array('@webid-net' => 'http://www.w3.org/2005/Incubator/webid/spec/', '@handbook' =>
+        'http://drupal.org/handbook/modules/webidauth')) . '</p>';
+      $output .= '<h3>' . t('Uses') . '</h3>';
+      $output .= '<dl>';
+      $output .= '<dt>' . t('Logging in with WebID') . '</dt>';
+      $output .= '<dd>' . t("To log in using WebID, a user must already have an WebID certificate. Users can then create site accounts using their WebID, assign one or more WebIDs to an existing account, and log in using an WebID. This lowers the barrier to registration, which helps increase the user base, and offers convenience and security to the users. Because WebID cannot guarantee a user is legitimate, email verification is still necessary. When logging in, users are presented with a browser dialog window to select their WebID certificate. The site then communicates with the WebID server, asking it to verify the identity of the user. If the user is logged into their WebID server, the server communicates back to your site, verifying the user.") .
+        '</dd>';
+      $output .= '</dl>';
+      return $output;
+  }
 }
 
 /**
  * Implements hook_user_insert().
  */
 function webidauth_user_insert(&$edit, $account, $category) {
-    if (!empty($edit['webidauth_claimed_id'])) {
-        // The user has registered after trying to log in via WebID.
-        if (variable_get('user_email_verification', TRUE)) {
-            drupal_set_message(t('Once you have verified your e-mail address, you may log in via WebID.'));
-        }
-
-        _webidauth_save( $_SESSION['foaf'], $account->uid);
+  if (!empty($edit['webidauth_claimed_id'])) {
+    // The user has registered after trying to log in via WebID.
+    if (variable_get('user_email_verification', TRUE)) {
+      drupal_set_message(t('Once you have verified your e-mail address, you may log in via WebID.'));
     }
+  _webidauth_save( $_SESSION['foaf'], $account->uid);
+  }
 }
 
-
 /**
  * Implements hook_user_delete().
  */
 function webidauth_user_delete($account) {
-    db_delete('webidauth')->condition('uid', $account->uid)->execute();
+  db_delete('webidauth')->condition('uid', $account->uid)->execute();
 }
 
-
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-
-function webidauth_form_user_login_block_alter(&$form, &$form_state)
-{
-    _webidauth_user_login_form_alter($form, $form_state);
+function webidauth_form_user_login_block_alter(&$form, &$form_state) {
+  _webidauth_user_login_form_alter($form, $form_state);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
 function webidauth_form_user_login_alter(&$form, &$form_state) {
-    _webidauth_user_login_form_alter($form, $form_state);
+  _webidauth_user_login_form_alter($form, $form_state);
 }
 
 /**
  * _webidauth_user_login_form_alter()
  */
 function _webidauth_user_login_form_alter(&$form, &$form_state) {
-    $form['#attached']['css'][] = drupal_get_path('module', 'webidauth') .
-        '/webidauth.css';
-    $form['#attached']['js'][] = drupal_get_path('module', 'webidauth') .
-        '/webidauth.js';
-    $form['#attached']['library'][] = array('system', 'jquery.cookie');
-
-    global $base_url;
-    $items = array();
-    $items[] = array('data' => l(t('Log in using WebID'), variable_get('webidauth_auth_server',
-        DEFAULT_WEBID_VALIDATOR) . '?authreqissuer=' . $base_url .
-        "/?q=webidauth/authenticate", array('external' => TRUE)), 'class' => array('webidauth-link'), );
-
-    $items[] = array('data' => l(t('Cancel WebID login'), '#', array('external' => TRUE)),
-        'class' => array('user-link'), );
-
-    $form['webidauth_links'] = array('#theme' => 'item_list', '#items' => $items,
-        '#attributes' => array('class' => array('webidauth-links')), '#weight' => 1, );
-
-    $form['links']['#weight'] = 2;
-
-
-    $form['webidauth.return_to'] = array('#type' => 'hidden', '#value' => url('webidauth/authenticate',
-        array('absolute' => TRUE, 'query' => user_login_destination())));
+  $form['#attached']['css'][] = drupal_get_path('module', 'webidauth') .
+    '/webidauth.css';
+  $form['#attached']['js'][] = drupal_get_path('module', 'webidauth') .
+    '/webidauth.js';
+  $form['#attached']['library'][] = array('system', 'jquery.cookie');
+  global $base_url;
+  $items = array();
+  $items[] = array('data' => l(t('Log in using WebID'), variable_get('webidauth_auth_server',
+    DEFAULT_WEBID_VALIDATOR) . '?authreqissuer=' . $base_url .
+    "/?q=webidauth/authenticate", array('external' => TRUE)), 'class' => array('webidauth-link'), );
+  $items[] = array('data' => l(t('Cancel WebID login'), '#', array('external' => TRUE)),
+    'class' => array('user-link'), );
+  $form['webidauth_links'] = array('#theme' => 'item_list', '#items' => $items,
+    '#attributes' => array('class' => array('webidauth-links')), '#weight' => 1, );
+  $form['links']['#weight'] = 2;
+  $form['webidauth.return_to'] = array('#type' => 'hidden', '#value' => url('webidauth/authenticate',
+    array('absolute' => TRUE, 'query' => user_login_destination())));
 }
 
-
 /**
- * Implements hook_admin()
+ * Implements hook_admin().
  */
 function webidauth_admin() {
-    $form = array();
-
-    $form['webidauth_auth_server_uri'] = array('#type' => 'textfield', '#title' => t
-        ('WebID authentication server URI'), '#default_value' => variable_get('webidauth_auth_server',
-        DEFAULT_WEBID_VALIDATOR), '#size' => 32, '#description' => t("The address of the WebID authentication server."),
-        '#required' => TRUE, );
-    $form['webidauth_auth_server_cert'] =  array('#type' => 'textarea', '#title' => t
-        ('WebID authentication server public certificate'), '#default_value' => variable_get('webidauth_auth_server_certificate',
-        DEFAULT_WEBID_VALIDATOR_CERTIFICATE), '#size' => 32, '#description' => t("The public certificate of the WebID authentication server."),
-        '#required' => TRUE, );
-    $form['#submit'][] = 'webidauth_admin_submit';
-    $form['#validate'][] = 'webidauth_admin_validate';
-    return system_settings_form($form);
+  $form = array();
+  $form['webidauth_auth_server_uri'] = array('#type' => 'textfield', '#title' => t
+    ('WebID authentication server URI'), '#default_value' => variable_get('webidauth_auth_server',
+    DEFAULT_WEBID_VALIDATOR), '#size' => 32, '#description' => t("The address of the WebID authentication server."),
+    '#required' => TRUE, );
+  $form['webidauth_auth_server_cert'] =  array('#type' => 'textarea', '#title' => t
+    ('WebID authentication server public certificate'), '#default_value' => variable_get('webidauth_auth_server_certificate',
+    DEFAULT_WEBID_VALIDATOR_CERTIFICATE), '#size' => 32, '#description' => t("The public certificate of the WebID authentication server."),
+    '#required' => TRUE, );
+  $form['#submit'][] = 'webidauth_admin_submit';
+  $form['#validate'][] = 'webidauth_admin_validate';
+  return system_settings_form($form);
 }
 
 
 /**
- * webidauth admin form validate hook
+ * webidauth admin form validate hook.
  *
  * @param mixed $form
  * @param mixed $form_state
  * @return
  */
 function webidauth_admin_validate($form, &$form_state) {
-    $webiduri = $form_state['values']['webidauth_auth_server_uri'];
-
-    if (valid_url($webiduri, TRUE) === FALSE)
-        form_set_error('webidauth_auth_server_uri', t('You must enter a valid URI.'));
-
-
+  $webiduri = $form_state['values']['webidauth_auth_server_uri'];
+  if (valid_url($webiduri, TRUE) === FALSE)
+    form_set_error('webidauth_auth_server_uri', t('You must enter a valid URI.'));
 }
 
 /**
- * webidauth admin form submit hook
+ * webidauth admin form submit hook.
  *
  * @param mixed $form
  * @param mixed $form_state
  * @return
  */
 function webidauth_admin_submit($form, &$form_state) {
-    if (valid_url($form_state['values']['webidauth_auth_server_uri'])) {
-        variable_set('webidauth_auth_server', $form_state['values']['webidauth_auth_server_uri']);
-
-        variable_set('webidauth_auth_certificate', $form_state['values']['webidauth_auth_server_cert']);
-
-        drupal_set_message(t('Your configuration has been saved.'));
-
-    }
+  if (valid_url($form_state['values']['webidauth_auth_server_uri'])) {
+    variable_set('webidauth_auth_server', $form_state['values']['webidauth_auth_server_uri']);
+    variable_set('webidauth_auth_certificate', $form_state['values']['webidauth_auth_server_cert']);
+    drupal_set_message(t('Your configuration has been saved.'));
+  }
 }
 
 /**
- * Implements hook_user_view_alter()
+ * Implements hook_user_view_alter().
  */
 function webidauth_user_view_alter(&$build) {
-    $edited_user = $build['#account'];
-
-    $user_data = db_select('webidauth', 'w');
-    $user_data->join('users', 'u', 'w.uid = u.uid');
-    $user_data->groupBy('u.uid'); //GROUP BY user ID
-    $user_data->fields('w', array('uri'))->condition('w.uid', $build['#account']->
+  $edited_user = $build['#account'];
+  $user_data = db_select('webidauth', 'w');
+  $user_data->join('users', 'u', 'w.uid = u.uid');
+  $user_data->groupBy('u.uid'); //GROUP BY user ID
+  $user_data->fields('w', array('uri'))->condition('w.uid', $build['#account']->
         uid, '=');
-
-    $user_obj = $user_data->execute()->fetchObject();
-    if ($user_obj === FALSE)
-        return;
-    $foaf = new FoafParser($user_obj->uri);
-    $img = $foaf->getImage();
-    if ($build["user_picture"]["#markup"] === '')
-        $build["user_picture"]["#markup"] = t('<img height="100" src="' . $img . '"/>');
+  $user_obj = $user_data->execute()->fetchObject();
+  if ($user_obj === FALSE)
+    return;
+  $foaf = new FoafParser($user_obj->uri);
+  $img = $foaf->getImage();
+  if ($build["user_picture"]["#markup"] === '')
+    $build["user_picture"]["#markup"] = t('<img height="100" src="' . $img . '"/>');
 }
 
 /**
@@ -298,75 +270,67 @@ function webidauth_user_view_alter(&$build) {
  * Fills the user profile form with values acquired via WebID.
  */
 function webidauth_form_user_profile_form_alter(&$form, &$form_state) {
-    $edited_user = $form_state['user'];
-
-    $user_data = db_select('webidauth', 'w');
-    $user_data->join('users', 'u', 'w.uid = u.uid');
-    $user_data->groupBy('u.uid'); //GROUP BY user ID
-
-    $user_data->fields('w', array('uri'))->condition('w.uid', $edited_user->uid, '=');
-
-    $user_obj = $user_data->execute()->fetchObject();
-    if ($user_obj !== FALSE) {
-
-        $foaf = new FoafParser($user_obj->uri);
-
-        $img = $foaf->getImage();
-
-        $form['account']['picture']['#markup'] = t('<img height="100" src="' . $img .
+  $edited_user = $form_state['user'];
+  $user_data = db_select('webidauth', 'w');
+  $user_data->join('users', 'u', 'w.uid = u.uid');
+  $user_data->groupBy('u.uid'); //GROUP BY user ID
+  $user_data->fields('w', array('uri'))->condition('w.uid', $edited_user->uid, '=');
+  $user_obj = $user_data->execute()->fetchObject();
+  if ($user_obj !== FALSE) {
+    $foaf = new FoafParser($user_obj->uri);
+    $img = $foaf->getImage();
+    $form['account']['picture']['#markup'] = t('<img height="100" src="' . $img .
             '"/>');
-    }
+  }
 }
 
 /**
- * webidauth admin user register form validate hook
+ * webidauth admin user register form validate hook.
  *
  * @param mixed $form
  * @param mixed $form_state
  * @return
  */
 function webidauth_admin_user_register_validate(&$form, &$form_state) {
-    if (user_access('administer users') !== TRUE)
-        return;
-
-    if ($form_state['values']['pass'] === '') {
-        if ($form_state['values']['foaf_uri'] === '') {
-            form_set_error('pass', t('You must either enter a valid password or provide a FOAF URI.'));
-            form_set_error('foaf_uri', t('You must either enter a valid password or provide a FOAF URI.'));
-        } else {
-            $form_state['values']['pass'] = user_password();
-        }
+  if (user_access('administer users') !== TRUE)
+    return;
+  if ($form_state['values']['pass'] === '') {
+    if ($form_state['values']['foaf_uri'] === '') {
+      form_set_error('pass', t('You must either enter a valid password or provide a FOAF URI.'));
+      form_set_error('foaf_uri', t('You must either enter a valid password or provide a FOAF URI.'));
     }
-
-    if ($form_state['values']['foaf_uri'] !== '') {
-        if (valid_url($form_state['values']['foaf_uri'], TRUE) === FALSE) {
-            form_set_error('foaf_uri', t('You must enter a valid FOAF URI.'));
-            return;
-        }
-        $uri = $form_state['values']['foaf_uri'];
-        $u = _webidauth_exists($uri);
-        if ($u !== FALSE)
-            form_set_error('foaf_uri', t('The claimed WebID is already used by another user. Please
-             review user <a href="user/' . $u->uid . '/webidauth/">' . $u->name .
-                '</a> before continuing.'));
+    else {
+      $form_state['values']['pass'] = user_password();
+    }
+  }
+  if ($form_state['values']['foaf_uri'] !== '') {
+    if (valid_url($form_state['values']['foaf_uri'], TRUE) === FALSE) {
+      form_set_error('foaf_uri', t('You must enter a valid FOAF URI.'));
+      return;
     }
+    $uri = $form_state['values']['foaf_uri'];
+    $u = _webidauth_exists($uri);
+    if ($u !== FALSE)
+      form_set_error('foaf_uri', t('The claimed WebID is already used by another user. Please
+      review user <a href="user/' . $u->uid . '/webidauth/">' . $u->name .
+      '</a> before continuing.'));
+  }
 }
 
 /**
- * webidauth admin user register form submit hook
+ * webidauth admin user register form submit hook.
  *
  * @param mixed $form
  * @param mixed $form_state
  * @return
  */
 function webidauth_admin_user_register_submit(&$form, &$form_state) {
-    user_register_submit($form, $form_state);
-    $uid = $form_state['values']['uid'];
-    $uri = $form_state['values']['foaf_uri'];
-    if ($uid) {
-
-        _webidauth_save($uri, $uid);
-    }
+  user_register_submit($form, $form_state);
+  $uid = $form_state['values']['uid'];
+  $uri = $form_state['values']['foaf_uri'];
+  if ($uid) {
+    _webidauth_save($uri, $uid);
+  }
 }
 
 /**
@@ -375,73 +339,65 @@ function webidauth_admin_user_register_submit(&$form, &$form_state) {
  * Prefills the login form with values acquired via WebID.
  */
 function webidauth_form_user_register_form_alter(&$form, &$form_state) {
-    if (isset($_SESSION['foaf'])) {
-
-
-        $uri = $_SESSION['foaf'];
-        $foaf = new FoafParser($uri);
-        $username = $foaf->getName();
-        $img = $foaf->getImage();
-        $email = $foaf->getMailbox();
-        $user_data = db_select('users', 'u');
-        $user_data->fields('u', array('name'))->condition(db_or()->condition('u.name', $username,
-            '=')->condition('u.mail', $email, '='));
-
-        $user_obj = $user_data->execute()->fetchObject();
-
-        if ($user_obj !== FALSE) {
-
-
-            $form['note'] = array('#weight' => -20, '#type' => 'item', '#title' => t('Already a member?'),
-                '#description' => t('It seems you already have an account with the username ' .
-                $username . ' or email address ' . $email . ',
-         loaded from your WebID profile.
-         If that account is yours, please login first using your username and password and add your WebID to your account,
-         afterwards, to be able to login both ways.'), );
-        }
-
-        $form['foaf_image'] = array('#weight' => -10, '#markup' => t('<img height="100" src="' .
-            $img . '"/>'), );
-        if (!empty($username)) {
-
-            $form['account']['name']['#default_value'] = $username;
-        } else {
-            $form['account']['name']['#default_value'] = '';
-        }
-
-        if (!empty($email)) {
-            // Use the email returned by Simple Registration if available.
-            $form['account']['mail']['#default_value'] = $email;
-        }
-
-        $user_data = db_select('webidauth', 'w');
-        // If user_email_verification is off, hide the password field and just fill
-        // with random password to avoid confusion.
-        if (!variable_get('user_email_verification', TRUE)) {
-            $form['account']['pass']['#type'] = 'hidden';
-            $form['account']['pass']['#value'] = user_password();
-        }
-
-        $form['webidauth_claimed_id'] = array('#type' => 'value', '#default_value' => $uri, );
-        $form['webidauth_display'] = array('#type' => 'item', '#title' => t('Your WebID'),
-            '#description' => t('This WebID will be attached to your account after registration.'),
-            '#markup' => check_plain($uri), );
-    } else {
-        if (user_access('administer users') !== TRUE)
-            return;
-        $form['account']['foaf_uri'] = array('#type' => 'textfield', '#title' => t('Foaf URI'),
-            '#size' => 32, '#description' => t("You can provide a FOAF profile for the user to login via WebID. If so, you don't need to enter a password"), );
-        $form['account']['pass']['#required'] = FALSE;
-        $form['#validate'][] = 'webidauth_admin_user_register_validate';
-        $form['#submit'] = array('webidauth_admin_user_register_submit'); //override the default submit
+  if (isset($_SESSION['foaf'])) {
+    $uri = $_SESSION['foaf'];
+    $foaf = new FoafParser($uri);
+    $username = $foaf->getName();
+    $img = $foaf->getImage();
+    $email = $foaf->getMailbox();
+    $user_data = db_select('users', 'u');
+    $user_data->fields('u', array('name'))->condition(db_or()->condition('u.name', $username,
+      '=')->condition('u.mail', $email, '='));
+    $user_obj = $user_data->execute()->fetchObject();
+    if ($user_obj !== FALSE) {
+      $form['note'] = array('#weight' => -20, '#type' => 'item', '#title' => t('Already a member?'),
+        '#description' => t('It seems you already have an account with the username ' .
+        $username . ' or email address ' . $email . ',
+        loaded from your WebID profile.
+        If that account is yours, please login first using your username and password and add your WebID to your account,
+        afterwards, to be able to login both ways.'), );
+    }
+    $form['foaf_image'] = array('#weight' => -10, '#markup' => t('<img height="100" src="' .
+      $img . '"/>'), );
+    if (!empty($username)) {
+      $form['account']['name']['#default_value'] = $username;
+    }
+    else {
+      $form['account']['name']['#default_value'] = '';
+    }
+    if (!empty($email)) {
+      // Use the email returned by Simple Registration if available.
+      $form['account']['mail']['#default_value'] = $email;
+    }
+
+    $user_data = db_select('webidauth', 'w');
+    // If user_email_verification is off, hide the password field and just fill
+    // with random password to avoid confusion.
+    if (!variable_get('user_email_verification', TRUE)) {
+      $form['account']['pass']['#type'] = 'hidden';
+      $form['account']['pass']['#value'] = user_password();
     }
-}
 
+    $form['webidauth_claimed_id'] = array('#type' => 'value', '#default_value' => $uri, );
+    $form['webidauth_display'] = array('#type' => 'item', '#title' => t('Your WebID'),
+      '#description' => t('This WebID will be attached to your account after registration.'),
+      '#markup' => check_plain($uri), );
+    }
 
+  else {
+    if (user_access('administer users') !== TRUE)
+      return;
+    $form['account']['foaf_uri'] = array('#type' => 'textfield', '#title' => t('Foaf URI'),
+        '#size' => 32, '#description' => t("You can provide a FOAF profile for the user to login via WebID. If so, you don't need to enter a password"), );
+    $form['account']['pass']['#required'] = FALSE;
+    $form['#validate'][] = 'webidauth_admin_user_register_validate';
+    $form['#submit'] = array('webidauth_admin_user_register_submit'); //override the default submit
+  }
+}
 
 /**
  * webidauth_init()
- * Implements hook_init
+ * Implements hook_init().
  * @return
  */
 function webidauth_init() {
@@ -449,69 +405,70 @@ function webidauth_init() {
     drupal_add_js(drupal_get_path('module', 'webidauth') . '/tls_logout.js');
 }
 
-// Implements hook_libraries_info
 /**
  * webidauth_libraries_info()
  *
+ * Implements hook_libraries_info().
+ *
  * @return
  */
 function webidauth_libraries_info() {
-    $libraries['libAuthentication'] = array('name' => 'libAuthentication library',
-        'vendor url' => 'https://github.com/melvincarvalho/libAuthentication',
-        'download url' => 'https://github.com/melvincarvalho/libAuthentication/zipball/master',
-        'version arguments' => array('file' => 'readme.txt', 'pattern' => '/Version (\d+)/',
-        'lines' => 5, ), 'files' => array('php' => array('lib/Authentication.php'), ), );
-    $libraries['Graphite'] = array('name' => 'Graphite library', 'vendor url' =>
-        'http://graphite.ecs.soton.ac.uk/', 'download url' =>
-        'http://graphite.ecs.soton.ac.uk/download.php/Graphite_and_ARC2.tgz',
-        'version arguments' => array('file' => 'readme.txt', 'pattern' => '/Version (\d+)/',
-        'lines' => 5, ), 'files' => array('php' => array('Graphite.php'), ), );
-    $libraries['ARC2'] = array('name' => 'ARC RDF Classes for PHP ', 'vendor url' =>
-        'https://github.com/semsol/arc2', 'download url' =>
-        'https://github.com/semsol/arc2/zipball/master', 'version arguments' => array('file' =>
-        'readme.txt', 'pattern' => '/Version (\d+)/', 'lines' => 5, ), 'files' => array
-        ('php' => array('arc/ARC2.php'), ), );
-    return $libraries;
+  $libraries['libAuthentication'] = array('name' => 'libAuthentication library',
+    'vendor url' => 'https://github.com/melvincarvalho/libAuthentication',
+    'download url' => 'https://github.com/melvincarvalho/libAuthentication/zipball/master',
+    'version arguments' => array('file' => 'readme.txt', 'pattern' => '/Version (\d+)/',
+    'lines' => 5, ), 'files' => array('php' => array('lib/Authentication.php'), ), );
+  $libraries['Graphite'] = array('name' => 'Graphite library', 'vendor url' =>
+    'http://graphite.ecs.soton.ac.uk/', 'download url' =>
+    'http://graphite.ecs.soton.ac.uk/download.php/Graphite_and_ARC2.tgz',
+    'version arguments' => array('file' => 'readme.txt', 'pattern' => '/Version (\d+)/',
+    'lines' => 5, ), 'files' => array('php' => array('Graphite.php'), ), );
+  $libraries['ARC2'] = array('name' => 'ARC RDF Classes for PHP ', 'vendor url' =>
+    'https://github.com/semsol/arc2', 'download url' =>
+    'https://github.com/semsol/arc2/zipball/master', 'version arguments' => array('file' =>
+    'readme.txt', 'pattern' => '/Version (\d+)/', 'lines' => 5, ), 'files' => array
+      ('php' => array('arc/ARC2.php'), ), );
+  return $libraries;
 }
 
-
 /**
  * _webidauth_save()
- * saves a webid and associates it to the owning user
+ * saves a webid and associates it to the owning user.
+ *
  * @param mixed $uri The uri containing the foaf profile
  * @param mixed $uid The user that the webid willl be associated with
  * @return
  */
 function _webidauth_save($uri, $uid) {
-    db_insert('webidauth')->fields(array('uri' => $uri, 'uid' =>
-        $uid, ))->execute();
-    $account = user_load($uid);
-    user_set_authmaps($account, array('authname_webidauth' => $account->name));
+  db_insert('webidauth')->fields(array('uri' => $uri, 'uid' =>
+    $uid, ))->execute();
+  $account = user_load($uid);
+  user_set_authmaps($account, array('authname_webidauth' => $account->name));
 }
 
 /**
  * _webidauth_exists()
- * checks if a webid is assigned to a user and returns the user
+ * checks if a webid is assigned to a user and returns the user.
+ *
  * @param mixed $claimed_uri
  * @return FALSE if no user found, the user object otherwise
  */
 function _webidauth_exists($claimed_uri) {
-    $user_data = db_select('webidauth', 'w');
-    $user_data->join('users', 'u', 'w.uid = u.uid');
-
-    $user_data->fields('u', array('name', 'uid'))->condition('w.uri', $claimed_uri,
-        '=');
-
-    $user_obj = $user_data->execute()->fetchObject();
-    if ($user_obj !== FALSE) {
-
-        return $user_obj;
-    } else
-        return FALSE;
+  $user_data = db_select('webidauth', 'w');
+  $user_data->join('users', 'u', 'w.uid = u.uid');
+  $user_data->fields('u', array('name', 'uid'))->condition('w.uri', $claimed_uri,
+    '=');
+  $user_obj = $user_data->execute()->fetchObject();
+  if ($user_obj !== FALSE) {
+    return $user_obj;
+  }
+  else {
+    return FALSE;
+  }
 }
 
 /**
- * Implements hook_permission()
+ * Implements hook_permission().
  *
  * @return
  */
@@ -523,8 +480,7 @@ function webidauth_permission() {
     ),
     'modify webidauth identities' => array(
       'title' => t('Modify identities'),
-      'description' => t('Create new users only providing their webid, username and email, add and remove webid identities from users.'),
+      'description' => t('Create new users only providing their webid, username and email, add and remove WebID identities from users.'),
     ),
-
   );
 }
diff --git a/webidauth.pages.inc b/webidauth.pages.inc
index 5f7021d..1c39991 100644
--- a/webidauth.pages.inc
+++ b/webidauth.pages.inc
@@ -18,8 +18,7 @@
 /**
  * Menu callback; Manage WebID identities for the specified user.
  */
-function webidauth_user_identities($account)
-{
+function webidauth_user_identities($account) {
     global $user;
     drupal_set_title(format_username($account));
     drupal_add_css(drupal_get_path('module', 'webidauth') . '/webidauth.css');
@@ -55,12 +54,10 @@ function webidauth_user_identities($account)
  *
  * @return
  */
-function webidauth_add_page()
-{
-
-    global $user;
+function webidauth_add_page() {
+  global $user;
   $pubkey = array(variable_get('webidauth_auth_server_certificate', DEFAULT_WEBID_VALIDATOR_CERTIFICATE));
-  $auth = new Authentication_FoafSSLDelegate(false,NULL,NULL,new Authentication_X509CertRepo($pubkey));
+  $auth = new Authentication_FoafSSLDelegate(false, NULL, NULL, new Authentication_X509CertRepo($pubkey));
     if (isset($_REQUEST['error'])) {
         if ($_REQUEST['error'] === 'noVerifiedWebId')
             drupal_set_message(t('The provided WebID could not be verified.'), 'error');
@@ -69,40 +66,33 @@ function webidauth_add_page()
         $uri = $_REQUEST['webid'];
         if ($uri) {
             $u = _webidauth_exists($uri);
-            if ($u !== false) {
+            if ($u !== FALSE) {
 
                 drupal_set_message(t('The claimed WebID is already used by another user. Please
                 contact ' . variable_get('site_name') . ' administrator.'),
                     'warning');
                 drupal_goto('user/' . $user->uid . '/webidauth/');
-
-            } else {
-
-
+            }
+            else {
                 _webidauth_save( $uri, $user->uid);
 
                 drupal_set_message(t('The WebID was successfully associated with your account.'));
                 drupal_goto('user/' . $user->uid . '/webidauth/');
             }
-
         }
     }
-
 }
 
 
 /**
- * Menu callback; Authenticate with a  WebID identity for the logged in user.
+ * Menu callback; Authenticate with a WebID identity for the logged in user.
  *
  * @return
  */
-function webidauth_authentication_page()
-{
-
+function webidauth_authentication_page() {
     global $user;
     $pubkey = array(variable_get('webidauth_auth_server_certificate', DEFAULT_WEBID_VALIDATOR_CERTIFICATE));
-    $auth = new Authentication_FoafSSLDelegate(false,NULL,NULL,new Authentication_X509CertRepo($pubkey));
-
+    $auth = new Authentication_FoafSSLDelegate(false, NULL, NULL, new Authentication_X509CertRepo($pubkey));
 
     if (isset($_REQUEST['error'])) {
         if ($_REQUEST['error'] === 'noVerifiedWebId' ||$_REQUEST['error']==='certNoOwnership' )
@@ -117,27 +107,27 @@ function webidauth_authentication_page()
     if (user_is_logged_in())
         return;
 
-    if ($auth->isAuthenticated()) {//successful WebID validation
+    if ($auth->isAuthenticated()) {
+      //successful WebID validation
         $uri = $_REQUEST['webid'];
         if ($uri) {
             $foaf = new FoafParser($uri);
 
             $u = _webidauth_exists($uri);
-            if ($u !== false) {
+            if ($u !== FALSE) {
 
                 user_external_login_register(trim($u->name), 'webidauth');
                 drupal_goto('<front>');
-
-
-            } else {//create the account with the username & email if they don't already exist, else go to register page
-
+            }
+            else {
+              //create the account with the username & email if they don't already exist, else go to register page
                 $existing_user_data = db_select('users', 'u');
                 $existing_user_data->fields('u', array('name'))->condition(db_or()->condition('u.name', trim($foaf->getName()),
                     '=')->condition('u.mail', $email, '='));
 
                 $existing_user_obj = $existing_user_data->execute()->fetchObject();
-                if ($existing_user_obj !== false ||
-                     (trim($foaf->getName())== '' || trim($foaf->getMailbox())== '')
+                if ($existing_user_obj !== FALSE ||
+                  (trim($foaf->getName())== '' || trim($foaf->getMailbox())== '')
                 ) {
                     $_SESSION['foaf'] = $uri;
                     drupal_goto('user/register');
@@ -146,32 +136,23 @@ function webidauth_authentication_page()
                 else{
 
                     user_external_login_register(trim($foaf->getName()), 'webidauth');
-                    if(user_is_logged_in()){
-                        _webidauth_save($uri,$user->uid);
+                    if (user_is_logged_in()) {
+                        _webidauth_save($uri, $user->uid);
                         $user->mail = trim($foaf->getMailbox());
                         user_save($user);
                     }
                     drupal_goto('<front>');
-
                 }
-
-
-
-
             }
-
         }
-
     }
-
 }
 
 
 /**
  * Menu callback; Add a WebID identity for the specified user.
  */
-function admin_webidauth_user_add()
-{
+function admin_webidauth_user_add() {
     $form['webidauth_identifier'] = array('#type' => 'textfield', '#title' => t('WebID FOAF-Profile URL'), );
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add a WebID'));
@@ -185,29 +166,24 @@ function admin_webidauth_user_add()
  * @param mixed $form_state
  * @return
  */
-function admin_webidauth_user_add_submit($form, &$form_state)
-{
-    $return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => true));
+function admin_webidauth_user_add_submit($form, &$form_state) {
+    $return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => TRUE));
     $uri = $form_state['values']['webidauth_identifier'];
     if ($uri) {
 
 
         $u = _webidauth_exists($uri);
-        if ($u !== false) {
+        if ($u !== FALSE) {
             drupal_set_message(t('The claimed WebID is already used by another user. Please
              review user <a href="user/' . $u->uid . '/webidauth/">' . $u->name .
                 '</a> before continuing.'), 'warning');
-
-        } else {
-
-
+        }
+        else {
             _webidauth_save($uri, arg(1));
             drupal_set_message(t('The WebID was successfully associated with the selected account.'));
             drupal_goto('user/' . arg(1) . '/webidauth/');
         }
-
     }
-
 }
 
 /**
@@ -216,9 +192,7 @@ function admin_webidauth_user_add_submit($form, &$form_state)
  * @ingroup forms
  * @see webid_user_add_validate()
  */
-function webidauth_user_add()
-{
-
+function webidauth_user_add() {
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add a WebID'));
     return $form;
@@ -228,9 +202,8 @@ function webidauth_user_add()
 /**
  * submit hook for the webidauth_user_add form
  */
-function webidauth_user_add_submit($form, &$form_state)
-{
-    $return_to = url('user/' . arg(1) . '/webidauth/add', array('absolute' => true));
+function webidauth_user_add_submit($form, &$form_state) {
+    $return_to = url('user/' . arg(1) . '/webidauth/add', array('absolute' => TRUE));
     //$return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => true));
 
     global $base_url;
@@ -240,8 +213,7 @@ function webidauth_user_add_submit($form, &$form_state)
 /**
  * Menu callback; Delete the specified WebID identity from the system.
  */
-function webidauth_user_delete_form($form, $form_state, $account, $wid = 0)
-{
+function webidauth_user_delete_form($form, $form_state, $account, $wid = 0) {
 
     $user_data = db_select('webidauth', 'w');
 
@@ -265,8 +237,7 @@ function webidauth_user_delete_form($form, $form_state, $account, $wid = 0)
 /**
  * submit hook for the webidauth_user_delete form
  */
-function webidauth_user_delete_form_submit($form, &$form_state)
-{
+function webidauth_user_delete_form_submit($form, &$form_state) {
 
     $query = db_delete('webidauth')->condition('uid', $form_state['build_info']['args'][0]->
         uid)->condition('wid', $form_state['build_info']['args'][1])->execute();
diff --git a/webidauth.parser.inc b/webidauth.parser.inc
index 208f3e3..b969ed7 100644
--- a/webidauth.parser.inc
+++ b/webidauth.parser.inc
@@ -10,64 +10,59 @@
  *      Dimitris Spachos
  */
 
-class FoafParser
-{
+/**
+ * @file
+ * FoafParser for Drupal
+ */
+
+class FoafParser {
     /**
      * FoafParser::__construct()
      * Constructs a new instance of the FoafParser class
      * @param mixed $uri
      * @return
      */
-    public function __construct($uri)
-    {
-        $this->graphite = new Graphite();
-                $this->graphite->ns("cert", "http://www.w3.org/ns/auth/cert#");
-                $this->graphite->ns("rsa", "http://www.w3.org/ns/auth/rsa#");
-        $this->graphite->load($uri);
-        $this->uri = $uri;
-    }
+  public function __construct($uri) {
+    $this->graphite = new Graphite();
+      $this->graphite->ns("cert", "http://www.w3.org/ns/auth/cert#");
+      $this->graphite->ns("rsa", "http://www.w3.org/ns/auth/rsa#");
+    $this->graphite->load($uri);
+    $this->uri = $uri;
+  }
 
-    static private $graphite;
-    private $uri;
+  static private $graphite;
+  private $uri;
 
     /**
      * FoafParser::getName()
      * Returns the name of the person described in the foaf profile
      * @return
      */
-    public function getName()
-    {
-        return (string )$this->graphite->resource($this->uri)->get("foaf:nick");
-    }
+  public function getName() {
+    return (string )$this->graphite->resource($this->uri)->get("foaf:nick");
+  }
 
     /**
      * FoafParser::getImage()
      * Returns the image url of the person described in the foaf profile
      * @return
      */
-    public function getImage()
-    {
-        return (string )$this->graphite->resource($this->uri)->get("foaf:img");
-    }
+  public function getImage() {
+    return (string )$this->graphite->resource($this->uri)->get("foaf:img");
+  }
 
     /**
      * FoafParser::getMailbox()
      * Returns the email address of the person described in the foaf profile
      * @return
      */
-    public function getMailbox()
-    {
-        $prefix = 'mailto:';
-        $mbox = (string )$this->graphite->resource($this->uri)->get("foaf:mbox");
-
-        if ($mbox=='[NULL]') return '';
-
-        if (substr($mbox, 0, strlen($prefix) ) == $prefix) {
-            $mbox = substr($mbox, strlen($prefix), strlen($mbox) );
-        }
-
-
-        return $mbox ;
+  public function getMailbox() {
+    $prefix = 'mailto:';
+    $mbox = (string )$this->graphite->resource($this->uri)->get("foaf:mbox");
+    if ($mbox=='[NULL]') return '';
+    if (substr($mbox, 0, strlen($prefix) ) == $prefix) {
+      $mbox = substr($mbox, strlen($prefix), strlen($mbox) );
     }
-
+    return $mbox ;
+  }
 }
