diff --git a/bbb.module b/bbb.module
index 4a5aa21..7bacc30 100644
--- a/bbb.module
+++ b/bbb.module
@@ -40,7 +40,7 @@ include_once(drupal_get_path('modules', 'bbb') . 'includes/api.bbb.inc');
 /* Drupal Hooks */
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function bbb_views_api() {
   return array(
@@ -50,7 +50,7 @@ function bbb_views_api() {
 }
 
 /**
- * Implement HOOK_permission().
+ * Implements HOOK_permission().
  */
 function bbb_permission() {
   return array(
@@ -169,16 +169,14 @@ function bbb_access_moderator($node) {
   }
 
   // Check for node access and access start meetings
-  if (node_access('view', $node) &&
-      ((user_access('moderate meetings') || user_access('administer big blue button')) ||
-       $user->uid == $node->uid && user_access('moderate own meetings'))) {
+  if (node_access('view', $node) && ((user_access('moderate meetings') || user_access('administer big blue button')) || $user->uid == $node->uid && user_access('moderate own meetings'))) {
     return TRUE;
   }
   return FALSE;
 }
 
 /**
- * Implement HOOK_block_info
+ * Implements HOOK_block_info().
  */
 
 function bbb_block_info() {
@@ -189,7 +187,7 @@ function bbb_block_info() {
 }
 
 /**
- * Implement HOOK_block_view
+ * Implements HOOK_block_view().
  */
 
 function bbb_block_view($delta = '') {
@@ -212,7 +210,7 @@ function bbb_block_view($delta = '') {
  */
 function bbb_block_meeting($delta) {
   $output = '';
-  switch($delta) {
+  switch ($delta) {
     case 'bbb_login_meeting':
       $meeting = bbb_get_meeting(arg(1));
       if ($meeting) {
@@ -224,7 +222,7 @@ function bbb_block_meeting($delta) {
 }
 
 /**
- * Implement HOOK_form_alter().
+ * Implements HOOK_form_alter().
  */
 function bbb_form_alter(&$form, &$form_state, $form_id) {
 
@@ -302,7 +300,7 @@ function bbb_form_alter(&$form, &$form_state, $form_id) {
   }
 
   // Node edit form
-  if (array_key_exists('#node_edit_form',$form)) {
+  if (array_key_exists('#node_edit_form', $form)) {
     $node_type = $form['type']['#value'];
     if (drupal_substr($form_id, (drupal_strlen($form_id) - 10), 10) == '_node_form' &&
         bbb_is_meeting_type($node_type) &&
@@ -364,7 +362,7 @@ function bbb_form_alter(&$form, &$form_state, $form_id) {
 }
 
 /**
- * Implement HOOK_node_insert
+ * Implements HOOK_node_insert().
  */
 
 function bbb_node_insert($node) {
@@ -375,7 +373,7 @@ function bbb_node_insert($node) {
 }
 
 /**
- * Implement HOOK_node_update
+ * Implement HOOK_node_update().
  */
 
 function bbb_node_update($node) {
@@ -386,7 +384,7 @@ function bbb_node_update($node) {
 }
 
 /**
- * Implement HOOK_node_view
+ * Implement HOOK_node_view().
  */
 
 function bbb_node_view($node, $view_mode, $langcode) {
@@ -413,11 +411,11 @@ function bbb_node_view($node, $view_mode, $langcode) {
 }
 
 /**
- * Implement HOOK_node_load
+ * Implement HOOK_node_load().
  */
 
 function bbb_node_load($nodes, $types) {
-  foreach($nodes as $node) {
+  foreach ($nodes as $node) {
     if (bbb_is_meeting_type($node->type)) {
       $node->bbb = bbb_get_meeting($node->nid);
     }
@@ -425,7 +423,7 @@ function bbb_node_load($nodes, $types) {
 }
 
 /**
- * Implement HOOK_node_delete
+ * Implement HOOK_node_delete().
  */
 
 function bbb_node_delete($node) {
@@ -509,7 +507,7 @@ function bbb_is_meeting_owner($nid, $account = NULL) {
            INNER JOIN {node} n ON bm.nid = n.nid
            WHERE n.uid = :uid
              AND nid = :nid";
-  $owner = db_result(db_query($sql, array(':uid'=>$account->uid, ':nid' =>$nid)));
+  $owner = db_result(db_query($sql, array(':uid' => $account->uid, ':nid' => $nid)));
   return $owner ? TRUE : FALSE;
 }
 
@@ -517,7 +515,7 @@ function bbb_is_meeting_owner($nid, $account = NULL) {
  * Check if node type is meeting
  */
 function bbb_is_meeting_type($type) {
-  return variable_get('bbb_content_type_'. $type, FALSE);
+  return variable_get('bbb_content_type_' . $type, FALSE);
 }
 
 /**
@@ -534,7 +532,7 @@ function bbb_get_meeting($nid, $account = NULL, $cached = TRUE) {
 
   if (!isset($meetings[$nid]) || !$cached) {
     $meeting = new stdClass();
-    $result = db_query("SELECT * FROM {bbb_meetings} WHERE nid = :nid", array(':nid' =>$nid));
+    $result = db_query("SELECT * FROM {bbb_meetings} WHERE nid = :nid", array(':nid' => $nid));
     $meeting = $result->fetchObject();
     //debug($meeting);
 
@@ -570,11 +568,11 @@ function bbb_get_meeting($nid, $account = NULL, $cached = TRUE) {
  * Init meeting
  */
 function bbb_init_meeting($node = NULL, $params = array()) {
-  $welcome     = variable_get('bbb_content_type_welcome_'     . $node->type, '');
-  $dialNumber  = variable_get('bbb_content_type_dialNumber_'  . $node->type, '');
+  $welcome     = variable_get('bbb_content_type_welcome_' . $node->type, '');
+  $dialNumber  = variable_get('bbb_content_type_dialNumber_' . $node->type, '');
   $moderatorPW = variable_get('bbb_content_type_moderatorPW_' . $node->type, '');
-  $attendeePW  = variable_get('bbb_content_type_attendeePW_'  . $node->type, '');
-  $logoutURL   = variable_get('bbb_content_type_logoutURL_'   . $node->type, '');
+  $attendeePW  = variable_get('bbb_content_type_attendeePW_' . $node->type, '');
+  $logoutURL   = variable_get('bbb_content_type_logoutURL_' . $node->type, '');
   $settings = array(
     'nid'          => $node->nid,
     'name'         => $node->title,
@@ -625,7 +623,7 @@ function bbb_store_meeting($node, $params = array()) {
  * Delete meeting
  */
 function bbb_delete_meeting($nid) {
-  return db_query("DELETE FROM {bbb_meetings} WHERE nid = :nid", array(':nid'=>$nid));
+  return db_query("DELETE FROM {bbb_meetings} WHERE nid = :nid", array(':nid' => $nid));
 }
 
 /* Menu Callbacks */
@@ -674,7 +672,8 @@ function bbb_meeting_attend($node) {
       drupal_add_js(drupal_get_path('module', 'bbb') . '/js/check_status.bbb.js');
       drupal_set_message(t('You signed up for this meeting. Please stay on this page, you will be redirected immediately after the meeting has started.'));
       return node_show($node, NULL);
-    } else {
+    }
+    else {
       if (empty($meeting->initialized)) {
         if ($data = bbb_create_meeting($node, (array) $params)) {
           // Update local data
@@ -790,13 +789,13 @@ function bbb_redirect($node, $mode = 'attend') {
     case 'attend':
       // Get redirect URL
       $url = parse_url($meeting->url[$mode]);
-      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':'.$url['port'] : '' ) . $url['path'] . '?' . $url['query'];
+      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':' . $url['port'] : '' ) . $url['path'] . '?' . $url['query'];
       header('Location: ' . $fullurl, TRUE, 301);
       break;
     case 'moderate':
       // Get redirect URL
       $url = parse_url($meeting->url[$mode]);
-      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':'.$url['port'] : '' ) . $url['path'] . '?' . $url['query'];
+      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':' . $url['port'] : '' ) . $url['path'] . '?' . $url['query'];
       header('Location: ' . $fullurl, TRUE, 301);
       break;
   }
@@ -804,8 +803,8 @@ function bbb_redirect($node, $mode = 'attend') {
 
 function bbb_encode_int($string) {
   $ords = array();
-  for ($i = 0; $i < strlen($string); $i++) {
-    $ords[] = ord(substr($string, $i , 1));
+  for ($i = 0; $i < drupal_strlen($string); $i++) {
+    $ords[] = ord(drupal_substr($string, $i , 1));
   }
   return implode($ords);
 }
@@ -866,4 +865,4 @@ function theme_bbb_block_meeting($meeting) {
   }
   $output .= '</div>';
   return $output;
-}
+}
\ No newline at end of file
diff --git a/bbb_views.module b/bbb_views.module
index d3bcb6b..1e93694 100644
--- a/bbb_views.module
+++ b/bbb_views.module
@@ -10,7 +10,7 @@
  */
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function bbb_views_views_api() {
   return array(
diff --git a/includes/api.bbb.inc b/includes/api.bbb.inc
index fe82d71..711345b 100644
--- a/includes/api.bbb.inc
+++ b/includes/api.bbb.inc
@@ -1,58 +1,58 @@
 <?php
 /**
-* @file
-* BigBlueButton - Enables universities and colleges to deliver a high-quality
-* learning experience.
-*
-* @author
-* Stefan Auditor <stefan.auditor@erdfisch.de>
-*/
+ *  @file
+ *  BigBlueButton - Enables universities and colleges to deliver a high-quality
+ *  learning experience.
+ *
+ *  @author
+ *  Stefan Auditor <stefan.auditor@erdfisch.de>
+ */
 
 /**
-* Create Meeting (create)
-*
-* @param ARRAY $params
-*   Associative array of additional url parameters. Components:
-*   - name: STRING (REQUIRED) A name for the meeting.
-*   - meetingID: STRING A meeting ID that can be used to identify this meeting
-*     by the third party application. This is optional, and if not supplied,
-*     BBB will generate a meeting token that can be used to identify the
-*     meeting.
-*   - attendeePW: STRING The password that will be required for attendees to
-*     join the meeting. This is optional, and if not supplied, BBB will assign
-*     a random password.
-*   - moderatorPW: STRING The password that will be required for moderators to
-*     join the meeting or for certain administrative actions (i.e. ending a
-*     meeting). This is optional, and if not supplied, BBB will assign a
-*     random password.
-*   - welcome: STRING A welcome message that gets displayed on the chat window
-*     when the participant joins. You can include keywords (%%CONFNAME%%,
-*     %%DIALNUM%%, %%CONFNUM%%) which will be substituted automatically. You
-*     can set a default welcome message on bigbluebutton.properties
-*   - dialNumber: STRING The dial access number that participants can call in
-*     using regular phone. You can set a default dial number on
-*     bigbluebutton.properties
-*   - logoutURL: STRING The URL that the BigBlueButton client will go to after
-*     users click the OK button on the 'You have been logged out message'.
-*     This overrides, the value for bigbluebutton.web.loggedOutUrl if defined
-*     in bigbluebutton.properties
-* @return OBJECT or FALSE
-*   - meetingToken: STRING The internal meeting token assigned by the API for
-*     this meeting. It can be used by subsequent calls for joining or
-*     otherwise modifying a meeting's status.
-*   - meetingID: STRING The meeting ID supplied by the third party app, or
-*     null if none was supplied. If can be used in conjunction with a password
-*     in subsequent calls for joining or otherwise modifying a meeting's
-*     status.
-*   - attendeePW: STRING The password that will be required for attendees to
-*     join the meeting. If you did not supply one, BBB will assign a random
-*     password.
-*   - moderatorPW: STRING The password that will be required for moderators to
-*     join the meeting or for certain administrative actions (i.e. ending a
-*     meeting). If you did not supply one, BBB will assign a random password.
-*
-* @see http://code.google.com/p/bigbluebutton/wiki/API#Create_Meeting_(create)
-*/
+ *  Create Meeting (create)
+ *
+ *  @param ARRAY $params
+ *    Associative array of additional url parameters. Components:
+ *    - name: STRING (REQUIRED) A name for the meeting.
+ *    - meetingID: STRING A meeting ID that can be used to identify this meeting
+ *      by the third party application. This is optional, and if not supplied,
+ *      BBB will generate a meeting token that can be used to identify the
+ *      meeting.
+ *    - attendeePW: STRING The password that will be required for attendees to
+ *      join the meeting. This is optional, and if not supplied, BBB will assign
+ *      a random password.
+ *    - moderatorPW: STRING The password that will be required for moderators to
+ *      join the meeting or for certain administrative actions (i.e. ending a
+ *      meeting). This is optional, and if not supplied, BBB will assign a
+ *      random password.
+ *    - welcome: STRING A welcome message that gets displayed on the chat window
+ *      when the participant joins. You can include keywords (%%CONFNAME%%,
+ *      %%DIALNUM%%, %%CONFNUM%%) which will be substituted automatically. You
+ *      can set a default welcome message on bigbluebutton.properties
+ *    - dialNumber: STRING The dial access number that participants can call in
+ *      using regular phone. You can set a default dial number on
+ *      bigbluebutton.properties
+ *    - logoutURL: STRING The URL that the BigBlueButton client will go to after
+ *      users click the OK button on the 'You have been logged out message'.
+ *      This overrides, the value for bigbluebutton.web.loggedOutUrl if defined
+ *      in bigbluebutton.properties
+ *  @return OBJECT or FALSE
+ *    - meetingToken: STRING The internal meeting token assigned by the API for
+ *      this meeting. It can be used by subsequent calls for joining or
+ *      otherwise modifying a meeting's status.
+ *    - meetingID: STRING The meeting ID supplied by the third party app, or
+ *      null if none was supplied. If can be used in conjunction with a password
+ *      in subsequent calls for joining or otherwise modifying a meeting's
+ *      status.
+ *    - attendeePW: STRING The password that will be required for attendees to
+ *      join the meeting. If you did not supply one, BBB will assign a random
+ *      password.
+ *    - moderatorPW: STRING The password that will be required for moderators to
+ *      join the meeting or for certain administrative actions (i.e. ending a
+ *      meeting). If you did not supply one, BBB will assign a random password.
+ *
+ *  See http://code.google.com/p/bigbluebutton/wiki/API#Create_Meeting_(create)
+ */
 function bbb_api_create($params = array()) {
   $response = bbb_api_call($params, 'create');
   if (isset($response->returncode) && $response->returncode == 'SUCCESS') {
@@ -65,86 +65,89 @@ function bbb_api_create($params = array()) {
 }
 
 /**
-* Join Meeting (join)
-*
-* @param ARRAY $params
-*   Associative array of additional url parameters. Components:
-*   - fullName: STRING (REQUIRED) The full name that is to be used to identify
-*     this user to other conference attendees.
-*   - meetingToken: The internal meeting token assigned by the API for this
-*     meeting when it was created. Note that either the meetingToken or the
-*     meetingID along with one of the passwords must be passed into this call
-*     in order to determine which meeting to find.
-*   - meetingID: STRING If you specified a meeting ID when calling create,
-*     then you can use either the generated meeting token or your specified
-*     meeting ID to find meetings. This parameter takes your meeting ID.
-*   - password: STRING The password that this attendee is using. If the
-*     moderator password is supplied, he will be given moderator status (and
-*     the same for attendee password, etc)
-*   - redirectImmediately: BOOLEAN If this is passed as true, then BBB will
-*     not return a URL for you to redirect the user to, but will instead treat
-*     this as an entry URL and will immediately set up the client session and
-*     redirect the user into the conference.
-*     Values can be either a 1 (one) or a 0 (zero), indicating true or false
-*     respectively. Defaults to false.
-* @return STRING
-*   The URL that the user can be sent to in order to join the meeting. When
-*   they go to this URL, BBB will setup their client session and redirect them
-*   into the conference.
-*/
+ *  Join Meeting (join)
+ *
+ *  @param ARRAY $params
+ *    Associative array of additional url parameters. Components:
+ *    - fullName: STRING (REQUIRED) The full name that is to be used to identify
+ *      this user to other conference attendees.
+ *    - meetingToken: The internal meeting token assigned by the API for this
+ *      meeting when it was created. Note that either the meetingToken or the
+ *      meetingID along with one of the passwords must be passed into this call
+ *      in order to determine which meeting to find.
+ *    - meetingID: STRING If you specified a meeting ID when calling create,
+ *      then you can use either the generated meeting token or your specified
+ *      meeting ID to find meetings. This parameter takes your meeting ID.
+ *    - password: STRING The password that this attendee is using. If the
+ *      moderator password is supplied, he will be given moderator status (and
+ *      the same for attendee password, etc)
+ *    - redirectImmediately: BOOLEAN If this is passed as true, then BBB will
+ *      not return a URL for you to redirect the user to, but will instead treat
+ *      this as an entry URL and will immediately set up the client session and
+ *      redirect the user into the conference.
+ *      Values can be either a 1 (one) or a 0 (zero), indicating true or false
+ *      respectively. Defaults to false.
+ *  @return STRING
+ *    The URL that the user can be sent to in order to join the meeting. When
+ *    they go to this URL, BBB will setup their client session and redirect them
+ *    into the conference.
+ */
 function bbb_api_join($params) {
   $query_string = bbb_api_generate_querystring($params, 'join');
   return BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_JOIN_URL . '?' . $query_string;
 }
 
 /**
-* Is meeting running (isMeetingRunning)
-*
-* This call enables you to simply check on whether or not a meeting is running
-* by looking it up with either the token or your ID.
-*
-* @param ARRAY $params
-*   Associative array of additional url parameters. Components:
-*   - meetingToken: STRING The internal meeting token assigned by the API for
-*     this meeting when it was created.
-*   - meetingID: STRING If you specified a meeting ID when calling create,
-*     then you can use either the generated meeting token or your specified
-*     meeting ID to find meetings. This parameter takes your meeting ID.
-* @return BOOLEAN
-*   A string of either “true” or “false” that signals whether a meeting with
-*   this ID or token is currently running.
-*/
+ *  Is meeting running (isMeetingRunning)
+ *
+ *  This call enables you to simply check on whether or not a meeting is running
+ *  by looking it up with either the token or your ID.
+ *
+ *  @param ARRAY $params
+ *    Associative array of additional url parameters. Components:
+ *    - meetingToken: STRING The internal meeting token assigned by the API for
+ *      this meeting when it was created.
+ *    - meetingID: STRING If you specified a meeting ID when calling create,
+ *      then you can use either the generated meeting token or your specified
+ *      meeting ID to find meetings. This parameter takes your meeting ID.
+ *  @return BOOLEAN
+ *    A string of either “true” or “false” that signals whether a meeting with
+ *    this ID or token is currently running.
+ */
 function bbb_api_isMeetingRunning($params) {
   $response = bbb_api_call($params, 'isMeetingRunning');
   if (isset($response->returncode) && $response->returncode == 'SUCCESS') {
     return drupal_strtoupper($response->running) == 'TRUE' ? TRUE : FALSE;
   }
   else {
+    if (isset($response->returncode)) {
+      watchdog('bigbluebutton', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
+    }
     return FALSE;
   }
 }
 
 /**
-* End Meeting (endMeeting)
-*
-* Use this to forcibly end a meeting and kick all participants out of the
-* meeting.
-*
-* @param ARRAY $params
-*   Associative array of additional url parameters. Components:
-*   - meetingToken: STRING The internal meeting token assigned by the API for
-*     this meeting when it was created. Note that either the meetingToken or
-*     the meetingID along with one of the passwords must be passed into this
-*     call in order to determine which meeting to find.
-*   - meetingID: STRING If you specified a meeting ID when calling create,
-*     then you can use either the generated meeting token or your specified
-*     meeting ID to find meetings. This parameter takes your meeting ID.
-*   - password: STRING The moderator password for this meeting. You can not
-*     end a meeting using the attendee password.
-*  @return BOOLEAN
-*    A string of either “true” or “false” that signals whether the meeting was
-*    successfully ended.
-*/
+ *  End Meeting (endMeeting)
+ *
+ *  Use this to forcibly end a meeting and kick all participants out of the
+ *  meeting.
+ *
+ *  @param ARRAY $params
+ *    Associative array of additional url parameters. Components:
+ *    - meetingToken: STRING The internal meeting token assigned by the API for
+ *      this meeting when it was created. Note that either the meetingToken or
+ *      the meetingID along with one of the passwords must be passed into this
+ *      call in order to determine which meeting to find.
+ *    - meetingID: STRING If you specified a meeting ID when calling create,
+ *      then you can use either the generated meeting token or your specified
+ *      meeting ID to find meetings. This parameter takes your meeting ID.
+ *    - password: STRING The moderator password for this meeting. You can not
+ *      end a meeting using the attendee password.
+ *   @return BOOLEAN
+ *     A string of either “true” or “false” that signals whether the meeting was
+ *     successfully ended.
+ */
 // TODO: this call is not yet implemented.
 function bbb_api_endMeeting($params) {
   $response = bbb_api_call($params, 'endMeeting');
@@ -158,24 +161,24 @@ function bbb_api_endMeeting($params) {
 }
 
 /**
-* Get Meeting Info (getMeetingInfo)
-*
-* This call will return all of a meeting's information, including the list of
-* attendees as well as start and end times.
-*
-* @param ARRY $params
-*   Associative array of additional url parameters. Components:
-*   - meetingToken: STRING The internal meeting token assigned by the API for
-*     this meeting when it was created. Note that either the meetingToken or
-*     the meetingID along with one of the passwords must be passed into this
-*     call in order to determine which meeting to find.
-*   - meetingID: STRING If you specified a meeting ID when calling create,
-*     then you can use either the generated meeting token or your specified
-*     meeting ID to find meetings. This parameter takes your meeting ID.
-*   - password: STRING (REQUIRED) The moderator password for this meeting. You
-*     can not get the meeting information using the attendee password.
-* @return OBJECT or FALSE
-*/
+ *  Get Meeting Info (getMeetingInfo)
+ *
+ *  This call will return all of a meeting's information, including the list of
+ *  attendees as well as start and end times.
+ *
+ *  @param ARRY $params
+ *    Associative array of additional url parameters. Components:
+ *    - meetingToken: STRING The internal meeting token assigned by the API for
+ *      this meeting when it was created. Note that either the meetingToken or
+ *      the meetingID along with one of the passwords must be passed into this
+ *      call in order to determine which meeting to find.
+ *    - meetingID: STRING If you specified a meeting ID when calling create,
+ *      then you can use either the generated meeting token or your specified
+ *      meeting ID to find meetings. This parameter takes your meeting ID.
+ *    - password: STRING (REQUIRED) The moderator password for this meeting. You
+ *      can not get the meeting information using the attendee password.
+ *  @return OBJECT or FALSE
+ */
 // TODO: this call is not yet implemented.
 function bbb_api_getMeetingInfo($params) {
   $response = bbb_api_call($params, 'getMeetingInfo');
@@ -233,8 +236,9 @@ function bbb_api_call($params, $call) {
 }
 
 /**
-* Generate a signed query string
-*/
+ *  Generate a signed query string
+ */
+
 function bbb_api_generate_querystring($params = array(), $call = '') {
   $query = array();
   // URL encoding the parameters
@@ -249,11 +253,11 @@ function bbb_api_generate_querystring($params = array(), $call = '') {
 }
 
 /**
-* Parse xml response
-*
-* @param XML
-* @return OBJECT
-*/
+ *  Parse xml response
+ *
+ *  @param XML
+ *  @return OBJECT
+ */
 function bbb_api_parse_response($xml) {
   //TODO: Refactor
   $response = new StdClass;
@@ -263,4 +267,4 @@ function bbb_api_parse_response($xml) {
     }
   }
   return $response;
-}
+}
\ No newline at end of file
diff --git a/includes/bbb_views.views_default.inc b/includes/bbb_views.views_default.inc
index 507ada7..695baef 100644
--- a/includes/bbb_views.views_default.inc
+++ b/includes/bbb_views.views_default.inc
@@ -9,7 +9,7 @@
  */
 
 /**
- * Implementation of hook_views_default_views().
+ * Implements hook_views_default_views().
  */
 function bbb_views_views_default_views() {
   $view = new view;
