diff --git a/taxonomy_role.module b/taxonomy_role.module
index f353a93..00804ee 100644
--- a/taxonomy_role.module
+++ b/taxonomy_role.module
@@ -1,9 +1,9 @@
 <?php
-// $Id: 
+// $Id:
 
 /**
  * @file
- * Taxonomy role - allows restriction of access to vocabularies  
+ * Taxonomy role - allows restriction of access to vocabularies
  */
 
 /**
@@ -11,8 +11,8 @@
  */
 function taxonomy_role_help($path, $arg) {
   switch ($path) {
-    case 'admin/help#taxonomy_role':      
-      $output = '<p>'. t('This module allows you to restrict access to vocabularies on node forms by role. Once it is installed, you will need to configure the permissions for new and existing vocabularies.'). '</p>'; 
+    case 'admin/help#taxonomy_role':
+      $output = '<p>'. t('This module allows you to restrict access to vocabularies on node forms by role. Once it is installed, you will need to configure the permissions for new and existing vocabularies.'). '</p>';
       return $output;
   }
 }
@@ -31,15 +31,15 @@ function taxonomy_role_menu() {
       'description' => t('Configure Taxonomy Role settings.'),
       'type' => MENU_NORMAL_ITEM,
     );
-    
+
   return $items;
 }
 
 /**
  * Implementation of hook_form_alter().
  */
-function taxonomy_role_form_alter(&$form, &$form_state, $form_id) { 
-  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
+function taxonomy_role_form_alter(&$form, &$form_state, $form_id) {
+  if (isset($form['type']) && isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id) {
     if (!empty($form['taxonomy']) && is_array($form['taxonomy'])) {
       $visible = 0;
       foreach (element_children($form['taxonomy']) as $vid) {
