diff --git a/commentcloser.info b/commentcloser.info
index 7617065..11d01ab 100644
--- a/commentcloser.info
+++ b/commentcloser.info
@@ -2,5 +2,6 @@
 name = Comment closer
 description = Schedule automatic closing of comments for selected node types based on the age of the node
 core = 7.x
-files[] = commentcloser.module
+
 files[] = commentcloser.install
+files[] = commentcloser.module
diff --git a/commentcloser.install b/commentcloser.install
index 7a32659..08ef914 100644
--- a/commentcloser.install
+++ b/commentcloser.install
@@ -6,14 +6,14 @@
 /**
  * Implementation of hook_uninstall().
  */
-function comment_closer_uninstall() {
-  variable_del('comment_closer_age');
-  variable_del('comment_closer_cycle_period');
-  variable_del('comment_closer_next_date');
-  variable_del('comment_closer_types');
-  foreach (node_get_types('names') as $type => $name) {
-    variable_del("comment_closer_age_$type");
-    variable_del("comment_closer_notice_$type");
+function commentcloser_uninstall() {
+  variable_del('commentcloser_age');
+  variable_del('commentcloser_cycle_period');
+  variable_del('commentcloser_next_date');
+  variable_del('commentcloser_types');
+  foreach (node_type_get_names() as $type => $name) {
+    variable_del("commentcloser_age_$type");
+    variable_del("commentcloser_notice_$type");
   }
 
   drupal_set_message(t('Comment Closer module uninstalled.'));
@@ -23,29 +23,41 @@ function comment_closer_uninstall() {
  * Implementation of hook_update_N().
  * Change to per-content-type settings.
  */
-function comment_closer_update_6000() {
+function commentcloser_update_6000() {
   $ret = array();
 
-  $age = variable_get('comment_closer_age', 'never');
-  $types = variable_get('comment_closer_types', 0);
+  $age = variable_get('commentcloser_age', 'never');
+  $types = variable_get('commentcloser_types', 0);
   // If no types have been selected, then we work for all content types.
   if (empty($types) || !is_array($types)) {
-    $types = node_get_types('names');
+    $types = node_type_get_names();
   }
 
   foreach ($types as $type => $name) {
-    $v = "comment_closer_age_$type";
+    $v = "commentcloser_age_$type";
     variable_set($v, $age);
-    $ret[] = array('success' => TRUE, 'query' => "variable_set($v, $age)");
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => "variable_set($v, $age)",
+    );
   }
 
-  variable_del('comment_closer_cycle_period');
-  $ret[] = array('success' => TRUE, 'query' => '<strong>' . t('Comment Closer run frequency set to 1 day.') . '</strong>');
+  variable_del('commentcloser_cycle_period');
+  $ret[] = array(
+    'success' => TRUE,
+    'query' => '<strong>' . t('Comment Closer run frequency set to 1 day.') . '</strong>',
+  );
 
-  variable_del('comment_closer_age');
-  $ret[] = array('success' => TRUE, 'query' => "variable_del('comment_closer_age')");
-  variable_del('comment_closer_types');
-  $ret[] = array('success' => TRUE, 'query' => "variable_del('comment_closer_types')");
+  variable_del('commentcloser_age');
+  $ret[] = array(
+    'success' => TRUE,
+    'query' => "variable_del('commentcloser_age')",
+  );
+  variable_del('commentcloser_types');
+  $ret[] = array(
+    'success' => TRUE,
+    'query' => "variable_del('commentcloser_types')",
+  );
 
   return $ret;
 }
@@ -54,13 +66,16 @@ function comment_closer_update_6000() {
  * Implementation of hook_update_N().
  * Change to number, unit intervals.
  */
-function comment_closer_update_6001() {
+function commentcloser_update_6001() {
   $ret = array();
 
-  $types = node_get_types('names');
+  $types = node_type_get_names();
   foreach ($types as $type => $name) {
-    $age = variable_get("comment_closer_age_$type", 'never');
-    $ret[] = array('success' => TRUE, 'query' => "variable_del('comment_closer_age_$type')");
+    $age = variable_get("commentcloser_age_$type", 'never');
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => "variable_del('commentcloser_age_$type')",
+    );
     if ($age == 'never') {
       continue;
     }
@@ -78,11 +93,40 @@ function comment_closer_update_6001() {
       }
     }
 
-    variable_set("comment_closer_age_number_$type", $age_num);
-    $ret[] = array('success' => TRUE, 'query' => "variable_set('comment_closer_age_number_$type', $age_num)");
-    variable_set("comment_closer_age_unit_$type", $age_unit);
-    $ret[] = array('success' => TRUE, 'query' => "variable_set('comment_closer_age_unit_$type', $age_unit)");
+    variable_set("commentcloser_age_number_$type", $age_num);
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => "variable_set('commentcloser_age_number_$type', $age_num)",
+    );
+    variable_set("commentcloser_age_unit_$type", $age_unit);
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => "variable_set('commentcloser_age_unit_$type', $age_unit)",
+    );
   }
 
   return $ret;
 }
+
+/**
+ * Update variables names for Drupal 7.
+ */
+function commentcloser_update_7000(&$context) {
+  $vars = array(
+    'age',
+    'cycle_period',
+    'next_date',
+    'types',
+  );
+  foreach ($vars as $var) {
+    variable_set('commentcloser_' . $var, variable_get('comment_closer_' . $var, ''));
+    variable_del('comment_closer_' . $var);
+  }
+  foreach (node_type_get_names() as $type => $name) {
+    variable_set('commentcloser_age_' . $type, variable_get('comment_closer_age_' . $type, ''));
+    variable_set('commentcloser_notice_' . $type, variable_get('comment_closer_notice_' . $type, ''));
+    variable_del('comment_closer_age_' . $type);
+    variable_del('comment_closer_notice_' . $type);
+  }
+  return t('Updated comment closer variables.');
+}
diff --git a/commentcloser.module b/commentcloser.module
index 8d667d9..7dd151f 100644
--- a/commentcloser.module
+++ b/commentcloser.module
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * comment_closer.module
+ * commentcloser.module
  * Automatically close comments on nodes beyond a configurable age
  */
 
 /**
  * Implements hook_help().
  */
-function comment_closer_help($path, $arg) {
+function commentcloser_help($path, $arg) {
   switch ($path) {
     case 'admin/block/help':
       return t('<p>Automatically close comments</p>');
@@ -17,10 +17,8 @@ function comment_closer_help($path, $arg) {
     case "admin/modules#description":
       $output = t('Schedule automatic closing of comments for selected node types based on the age of the node');
       break;
-    case "admin/help#comment_closer":
-      $output = t('<p>The commentcloser module allows you to automatically close comments via a cron hook. You can select any combination of available node types to process,</p><p>Configure the module to close comments on nodes more than one week, month or year old and schedule the closings to be done daily, weekly, monthly or annually</p>
-
-      ');
+    case "admin/help#commentcloser":
+      $output = t('<p>The commentcloser module allows you to automatically close comments via a cron hook. You can select any combination of available node types to process,</p><p>Configure the module to close comments on nodes more than one week, month or year old and schedule the closings to be done daily, weekly, monthly or annually</p>');
       break;
     default:
       $output = "";
@@ -29,14 +27,20 @@ function comment_closer_help($path, $arg) {
   return $output;
 }
 
-function _comment_closer_nodeoptions() {
-  static $nodeoptions = array();
+/**
+ * Get a list of option settings for each node type.
+ *
+ * @return
+ *  An array of data???
+ */
+function _commentcloser_nodeoptions() {
+  $nodeoptions = &drupal_static(__FUNCTION__, array());
   if (!$nodeoptions) {
-    $nodetypes = node_get_types('names');
+    $nodetypes = node_type_get_names();
     foreach ($nodetypes as $type => $name) {
-      $age_unit = variable_get("comment_closer_age_unit_$type", 'day');
-      $age_num = variable_get("comment_closer_age_number_$type", 0);
-      $com_limit = variable_get("comment_closer_comment_limit_$type", 0);
+      $age_unit = variable_get("commentcloser_age_unit_$type", 'day');
+      $age_num = variable_get("commentcloser_age_number_$type", 0);
+      $com_limit = variable_get("commentcloser_comment_limit_$type", 0);
 
       if ($age_num || $com_limit) {
         $limits = array();
@@ -48,11 +52,11 @@ function _comment_closer_nodeoptions() {
         }
         $nodeoptions[$type] = t('@name (@age <a href="!edit?!ret">edit</a>)',
           array(
-            '@name' => $name,
-            '@age' => implode(', ', $limits),
-            '!edit' => url("admin/content/node-type/$type"),
-            '!ret' => drupal_get_destination(),
-            ));
+          '@name' => $name,
+          '@age' => implode(', ', $limits),
+          '!edit' => url("admin/content/node-type/$type"),
+          '!ret' => drupal_get_destination(),
+        ));
       }
     }
   }
@@ -62,72 +66,76 @@ function _comment_closer_nodeoptions() {
 
 /**
  * Settings form.
+ *
+ * TODO: this is never called anywhere...
  */
-function comment_closer_settings() {
+function commentcloser_settings() {
   $cc_form = array();
   $noyes = array(t('No'), t('Yes'));
 
   $cycle_length_list = array(
-//    0 => 0,             // Never
-    900 => 900,         // 15 mins
-    1800 => 1800,       // 30 mins
-    3600 => 3600,       // 1 hour
-    7200 => 7200,       // 2 hours
-    10800 => 10800,     // 3 hours
-    14400 => 14400,     // 4 hours
-    21600 => 21600,     // 6 hours
-    28800 => 28800,     // 8 hours
-    43200 => 43200,     // 12 hours
-    86400 => 86400,     // 1 day
-    172800 => 172800,   // 2 days
-    259200 => 259200,   // 3 days
-    604800 => 604800,   // 1 week
-    );
+    //    0 => 0,             // Never
+    900 => 900, // 15 mins
+    1800 => 1800, // 30 mins
+    3600 => 3600, // 1 hour
+    7200 => 7200, // 2 hours
+    10800 => 10800, // 3 hours
+    14400 => 14400, // 4 hours
+    21600 => 21600, // 6 hours
+    28800 => 28800, // 8 hours
+    43200 => 43200, // 12 hours
+    86400 => 86400, // 1 day
+    172800 => 172800, // 2 days
+    259200 => 259200, // 3 days
+    604800 => 604800, // 1 week
+  );
   $cycle_length_list = array_map('format_interval', $cycle_length_list);
   $cycle_length_list[0] = t('Do not run');
   ksort($cycle_length_list);
 
 
-  $cc_form['comment_closer_types'] = array(
-    '#type' => 'markup',
-    '#value' => '<label>' . t('Currently enabled content types') . '</label>'
-      . theme('item_list', _comment_closer_nodeoptions()) . '<br />',
+  $cc_form['commentcloser_types'] = array(
+    '#type' => 'item',
+    '#title' => t('Currently enabled content types'),
+    '#markup' => theme('item_list', array('items' => _commentcloser_nodeoptions())) . '<br />',
     '#prefix' => '<div class="form-item">',
     '#suffix' => '</div>',
-    );
+  );
 
-  $cc_form['comment_closer_cycle_period'] = array(
-    '#type' => 'select', '#size' => 3,
+  $cc_form['commentcloser_cycle_period'] = array(
+    '#type' => 'select',
+    '#size' => 3,
     '#title' => t('Run every'),
-    '#default_value' => variable_get('comment_closer_cycle_period', 86400),
+    '#default_value' => variable_get('commentcloser_cycle_period', 86400),
     '#options' => $cycle_length_list,
     '#attributes' => array('class' => 'container-inline'),
     '#description' => t('This is the interval for running the comment close check. It will run at the next Cron cycle after this time elapses. <strong>Note</strong> that comments may stay open for this interval <u>longer</u> than specified for the content type.'),
-    );
+  );
 
-  $cc_form['comment_closer_user_block'] = array(
+  $cc_form['commentcloser_user_block'] = array(
     '#type' => 'radios',
     '#title' => t('Disable comments for blocked users'),
-    '#default_value' => variable_get('comment_closer_user_block', 0),
+    '#default_value' => variable_get('commentcloser_user_block', 0),
     '#options' => $noyes,
     '#attributes' => array('class' => 'container-inline'),
     '#description' => t('If you choose yes, the content types selected above for any user who is blocked will have comments disabled. This happens at the time the user is blocked.'),
-    );
+  );
 
   return system_settings_form($cc_form);
 }
 
 /**
- * Implements hook_nodeapi().
+ * Implements hook_node_view().
+ *
  * Show a message about when the closing will happen.
  */
-function comment_closer_nodeapi(&$node, $op, $teaser, $page) {
+function commentcloser_node_view($node, $view_mode, $langcode) {
   // If we are on a cc node type and have enabled the notice, display it.
-  if (variable_get("comment_closer_age_number_$node->type", 0)
-    && variable_get("comment_closer_notice_$node->type", 0) == 1) {
-    if ($op == 'view' && $page == TRUE) {
-      $node->content['comment_closer_notice'] = array(
-        '#value' => theme('comment_closer_notice', $node),
+  if (variable_get("commentcloser_age_number_{$node->type}", 0)
+     && variable_get("commentcloser_notice_{$node->type}", 0) == 1) {
+    if ($view_mode == 'full') {
+      $node->content['commentcloser_notice'] = array(
+        '#markup' => theme('commentcloser_notice', array('node' => $node)),
         // Put it at the bottom, close to the comments.
         '#weight' => 10,
       );
@@ -138,21 +146,23 @@ function comment_closer_nodeapi(&$node, $op, $teaser, $page) {
 /**
  * Display a notice on nodes that comments will close.
  */
-function theme_comment_closer_notice($node) {
-  $age_num = variable_get("comment_closer_age_number_$node->type", 0);
-  $age_unit = variable_get("comment_closer_age_unit_$node->type", 'day');
+function theme_commentcloser_notice($variables) {
+  $node = $variables['node'];
+  // TODO: Should this theme commentcloser_notice be declared in hook_theme()?
+  $age_num = variable_get("commentcloser_age_number_$node->type", 0);
+  $age_unit = variable_get("commentcloser_age_unit_$node->type", 'day');
 
-  $type = node_get_types('name', $node);
+  $type = node_type_get_name($node);
 
   // Is commenting active now?
-  if ($node->comment == COMMENT_NODE_READ_WRITE) {
+  if ($node->comment == COMMENT_NODE_OPEN) {
     $when = strtotime("+$age_num $age_unit", $node->created);
 
     $output = '<p class="comment-closer-notice">' . t('Commenting on this @type will be automatically closed on !when.',
       array(
-        '!when' => format_date($when, 'custom', 'F j, Y'),
-        '@type' => $type,
-        )
+      '!when' => format_date($when, 'custom', 'F j, Y'),
+      '@type' => $type,
+    )
       ) . '</p>';
   }
   else {
@@ -165,73 +175,93 @@ function theme_comment_closer_notice($node) {
 /**
  * Implements hook_cron().
  */
-function comment_closer_cron() {
+function commentcloser_cron() {
   // Is it time to do anything?
-  $now = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time();
-  $next_cycle_time = variable_get('comment_closer_next_date', $now);
-  $period = variable_get('comment_closer_cycle_period', 86400);
-  if ($now < $next_cycle_time || $period == 0) {
+  $now = REQUEST_TIME;
+  $next_cycle_time = variable_get('commentcloser_next_date', $now);
+
+  $period = variable_get('commentcloser_cycle_period', 86400);
+  if (!empty($next_cycle_time) && ($now < $next_cycle_time || $period == 0)) {
     return;
   }
-
-  $content_types = node_get_types('names');
+  $content_types = node_type_get_names();
 
   foreach ($content_types as $type => $name) {
     // Set it up.
-    $age_num = variable_get("comment_closer_age_number_$type", 0);
-    $age_unit = variable_get("comment_closer_age_unit_$type", 'day');
-    $com_limit = variable_get("comment_closer_comment_limit_$type", 0);
+    $age_num = variable_get("commentcloser_age_number_$type", 0);
+    $age_unit = variable_get("commentcloser_age_unit_$type", 'day');
+    $com_limit = variable_get("commentcloser_comment_limit_$type", 0);
 
     // If an age number is set, do this one.
     if ($age_num) {
-      $oldest_allowed = _comment_closer_oldest_allowed($age_unit, $age_num, $now);
+      $oldest_allowed = _commentcloser_oldest_allowed($age_unit, $age_num, $now);
 
       // Knock it out.
-      $query = "UPDATE {node} SET comment = 1 WHERE created < %d AND type = '%s'";
-      $args = array($oldest_allowed, $type);
-      $result = db_query($query, $args);
-      $affected = db_affected_rows();
-      if ($affected) {
+      // Count the rows affected.
+      $count = db_query("SELECT COUNT(nid) FROM {node} WHERE created < :oldest AND type = :type AND comment = :comment",
+        array(':oldest' => $oldest_allowed, ':type' => $type, ':comment' => COMMENT_NODE_OPEN)
+      )->fetchField();
+      // Update those rows.
+      db_update('node')
+        ->fields(array('comment' => COMMENT_NODE_CLOSED))
+        ->condition('created', $oldest_allowed, '<')
+        ->condition('type', $type)
+        ->condition('comment', COMMENT_NODE_OPEN)
+        ->execute();
+      if ($count) {
         $vars = array(
-          '!count' => $affected,
+          '!count' => $count,
           '@types' => $name,
           '!date' => format_date($oldest_allowed),
-          );
+        );
         $msg = 'Closed comments on !count @types posts created at, or before, !date.';
-        watchdog('comment_closer', $msg, $vars, WATCHDOG_NOTICE);
+        watchdog('commentcloser', $msg, $vars, WATCHDOG_NOTICE);
       }
     }
 
     // If a comment limit is set, do this one.
     if ($com_limit) {
+      // Count the rows affected.
+      $count = db_query("SELECT COUNT(n.nid) FROM {node} n
+        INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid
+        WHERE n.type = :type AND ncs.comment_count >= :limit AND n.comment = :comment",
+        array(':type' => $type, ':limit' => $com_limit, ':comment' => COMMENT_NODE_OPEN)
+      )->fetchField();
       $query = "UPDATE {node} n, {node_comment_statistics} ncs "
         . "SET n.comment = 1 "
         . "WHERE ncs.nid = n.nid AND n.comment = 2 "
         . "AND ncs.comment_count >= %d AND n.type = '%s' "
         ;
-      $args = array($com_limit, $type);
-      $result = db_query($query, $args);
-      $affected = db_affected_rows();
-      if ($affected) {
+      // Update those rows.
+      $subquery = db_select('node_comment_statistics', 'ncs')
+        ->fields('ncs', array('nid'))
+        ->condition('ncs.comment_count', $com_limit, '>=');
+      db_update('node')
+        ->fields(array('comment' => COMMENT_NODE_CLOSED))
+        ->condition('comment', COMMENT_NODE_OPEN)
+        ->condition('type', $type)
+        ->condition('nid', $subquery, 'IN')
+        ->execute();
+      if ($count) {
         $vars = array(
-          '!count' => $affected,
+          '!count' => $count,
           '@types' => $name,
           '!com_count' => number_format($com_limit),
-          );
+        );
         $msg = 'Closed comments on !count @types posts with at least !com_count comments.';
-        watchdog('comment_closer', $msg, $vars, WATCHDOG_NOTICE);
+        watchdog('commentcloser', $msg, $vars, WATCHDOG_NOTICE);
       }
     }
   }
 
   // Do it again tomorrow.
-  variable_set('comment_closer_next_date', $next_cycle_time + $period);
+  variable_set('commentcloser_next_date', $next_cycle_time + $period);
 }
 
 /**
  * Helper function for generating date from age interval.
  */
-function _comment_closer_oldest_allowed($unit, $num, $now = NULL) {
+function _commentcloser_oldest_allowed($unit, $num, $now = NULL) {
   if (!in_array($unit, array('day', 'week', 'month', 'year'))) {
     drupal_set_message(t('Invalid unit ("@unit")', array('@unit' => $unit)));
   }
@@ -241,7 +271,7 @@ function _comment_closer_oldest_allowed($unit, $num, $now = NULL) {
   }
 
   if (empty($now)) {
-    $now = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time();
+    $now = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : REQUEST_TIME;
   }
 
   return strtotime("-$num $unit", $now);
@@ -250,12 +280,12 @@ function _comment_closer_oldest_allowed($unit, $num, $now = NULL) {
 /**
  * Implements hook_menu().
  */
-function comment_closer_menu() {
-  $items['admin/settings/comment_closer'] = array(
+function commentcloser_menu() {
+  $items['admin/config/commentcloser'] = array(
     'title' => 'Comment closer',
     'description' => 'Set age, frequency and types of nodes for which comments will be closed.',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('comment_closer_settings'),
+    'page arguments' => array('commentcloser_settings'),
     'access arguments' => array('administer site configuration'),
   );
   return $items;
@@ -264,42 +294,48 @@ function comment_closer_menu() {
 /**
  * Implements hook_theme().
  */
-function comment_closer_theme() {
+function commentcloser_theme($existing, $type, $theme, $path) {
   return array(
-    'comment_closer_notice' => array('arguments' => array('node' => NULL)),
-    );
+    'commentcloser_notice' => array('variables' => array('node' => NULL)),
+  );
 }
 
 /**
- * Implements hook_user().
+ * Implements hook_user_update().
  */
-function comment_closer_user($op, &$edit, &$account, $category = NULL) {
-  switch ($op) {
-    case 'after_update':
-      if (variable_get('comment_closer_user_block', 0) && $account->status == 1 && $edit['status'] == 0) {
-        $all_types = node_get_types('names');
-        $node_types = array();
-
-        // Process enabled content types.
-        foreach ($all_types as $type => $name) {
-          if (variable_get("comment_closer_age_number_$type", 0)) {
-            $query = "UPDATE {node} SET comment = 1 WHERE comment = 2 AND uid = %d AND type = '%s'";
-            db_query($query, $account->uid, $type);
-            $count = db_affected_rows();
-            if ($count) {
-              drupal_set_message(t('Comments were closed on !count @types posts.',
-                array('!count' => $count, '@types' => $name)));
-            }
-          }
+function commentcloser_user_update(&$edit, $account, $category) {
+  if (variable_get('commentcloser_user_block', 0) && $account->status == 1 && $edit['status'] == 0) {
+    $all_types = node_type_get_names();
+    $node_types = array();
+
+    // Process enabled content types.
+    foreach ($all_types as $type => $name) {
+      if (variable_get("commentcloser_age_number_$type", 0)) {
+        $query = "UPDATE {node} SET comment = 1 WHERE comment = 2 AND uid = %d AND type = '%s'";
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query($query, $account->uid, $type) */
+        db_update('node')
+  ->fields(array(
+          'comment' => 1,
+        ))
+  ->condition('comment', 2)
+  ->condition('uid', $account->uid)
+  ->condition('type', $type)
+  ->execute();
+        $count = db_affected_rows();
+        if ($count) {
+          drupal_set_message(t('Comments were closed on !count @types posts.',
+            array('!count' => $count, '@types' => $name)));
         }
       }
+    }
   }
 }
 
 /**
  * Helper function for building a list an "and" before the last item.
  */
-function _comment_closer_type_list($list) {
+function _commentcloser_type_list($list) {
   $last = array_pop($list);
   return implode(', ', $list) . (count($list) > 1 ? ',' : NULL) . " and $last";
 }
@@ -309,101 +345,91 @@ function _comment_closer_type_list($list) {
  *
  * Add the settings to the node edit form.
  */
-function comment_closer_form_alter(&$form, $form_state, $form_id) {
+function commentcloser_form_node_type_form_alter(&$form, &$form_state) {
   $noyes = array(t('No'), t('Yes'));
 
-  switch ($form_id) {
-    case 'node_type_form':
-      $type = $form['identity']['type']['#value'];
+  $type = $form['#node_type']->type;
 
-      // This setting should already be at the top, but force it.
-      $form['comment']['comment']['#weight'] = -10;
-      $form['comment']['comment']['#attributes'] = array('class' => 'container-inline');
+  // This setting should already be at the top, but force it.
+  $form['comment']['comment']['#weight'] = -10;
+  $form['comment']['comment']['#attributes'] = array('class' => array('container-inline'));
 
-      // Now we can add our settings directly below that.
-      $form['comment']['comment_closer'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Comment Closer'),
-        '#weight' => -9,
-        );
-
-      $form['comment']['comment_closer']['comment_closer_age'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Close commenting after'),
-        '#description' => t('A number of days, weeks, months, or years before which new comments will be disabled. A value of 0 means to not close comments. This is only effective when comments are "Read/Write" (see above). Note: there is no check for the date being beyond the limit of a Unix timestamp (2038).'),
-        );
+  // Now we can add our settings directly below that.
+  $form['comment']['commentcloser'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Comment Closer'),
+    '#weight' => -9,
+  );
 
-      $units = array(
-        'day' => t('days'),
-        'week' => t('weeks'),
-        'month' => t('months'),
-        'year' => t('years'),
-        );
+  $form['comment']['commentcloser']['commentcloser_age'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Close commenting after'),
+    '#description' => t('A number of days, weeks, months, or years before which new comments will be disabled. A value of 0 means to not close comments. This is only effective when comments are "Open" (see above). Note: there is no check for the date being beyond the limit of a Unix timestamp (2038).'),
+  );
 
-      // ******** Grouped on one line ********
-      $form['comment']['comment_closer']['comment_closer_age']['start'] = array(
-        '#type' => 'markup',
-        '#value' => '<table style="margin: 0 0 0 4em;"><tr>',
-        );
+  $units = array(
+    'day' => t('days'),
+    'week' => t('weeks'),
+    'month' => t('months'),
+    'year' => t('years'),
+  );
 
-      $form['comment']['comment_closer']['comment_closer_age']['comment_closer_age_number'] = array(
-        '#type' => 'textfield',
-        '#size' => 4,
-        '#maxlength' => 2,
-        '#default_value' => variable_get("comment_closer_age_number_$type", 0),
-        '#element_validate' => array('_comment_closer_age_validate'),
-        '#prefix' => '<td>',
-        '#suffix' => '</td>',
-        );
+  // ******** Grouped on one line ********
+  $form['comment']['commentcloser']['commentcloser_age']['start'] = array(
+    '#markup' => '<table style="margin: 0 0 0 4em;"><tr>',
+  );
 
-      $form['comment']['comment_closer']['comment_closer_age']['comment_closer_age_unit'] = array(
-        '#type' => 'select',
-        '#options' => $units,
-        '#default_value' => variable_get("comment_closer_age_unit_$type", 'never'),
-        '#prefix' => '<td>',
-        '#suffix' => '</td>',
-        );
+  $form['comment']['commentcloser']['commentcloser_age']['commentcloser_age_number'] = array(
+    '#type' => 'textfield',
+    '#size' => 4,
+    '#maxlength' => 2,
+    '#default_value' => variable_get("commentcloser_age_number_$type", 0),
+    '#element_validate' => array('_commentcloser_age_validate'),
+    '#prefix' => '<td>',
+    '#suffix' => '</td>',
+  );
 
-      $form['comment']['comment_closer']['comment_closer_age']['end'] = array(
-        '#type' => 'markup',
-        '#value' => '</tr></table>',
-        );
-      // *****************************
+  $form['comment']['commentcloser']['commentcloser_age']['commentcloser_age_unit'] = array(
+    '#type' => 'select',
+    '#options' => $units,
+    '#default_value' => variable_get("commentcloser_age_unit_$type", 'never'),
+    '#prefix' => '<td>',
+    '#suffix' => '</td>',
+  );
 
-      $form['comment']['comment_closer']['comment_closer_age']['or'] = array(
-        '#type' => 'markup',
-        '#value' => '<p style="margin-left: 5em;"><strong>' . t('- Or -') . '</strong></p>',
-        );
+  $form['comment']['commentcloser']['commentcloser_age']['end'] = array(
+    '#markup' => '</tr></table>',
+  );
+  // *****************************
 
-      $form['comment']['comment_closer']['comment_closer_age']['comment_closer_comment_limit'] = array(
-        '#type' => 'textfield',
-        '#size' => 4,
-        '#maxlength' => 4,
-        '#field_suffix' => t('comments'),
-        '#default_value' => variable_get("comment_closer_comment_limit_$type", 0),
-        '#prefix' => '<div style="margin: 0 0 0 4em;">',
-        '#suffix' => '</div>',
-        '#description' => t('If the post receives this many comments, close off further commenting. Leave this at zero (0) for no limit.'),
-        );
+  $form['comment']['commentcloser']['commentcloser_age']['or'] = array(
+    '#markup' => '<p style="margin-left: 5em;"><strong>' . t('- Or -') . '</strong></p>',
+  );
 
-      // *****************************
-      $form['comment']['comment_closer']['comment_closer_notice'] = array(
-        '#type' => 'radios',
-        '#title' => t('Display close notice on posts'),
-        '#options' => $noyes,
-        '#attributes' => array('class' => 'container-inline'),
-        '#default_value' => variable_get("comment_closer_notice_$type", 0),
-        '#description' => t('Checking "yes" will automatically display a notice at the bottom of all posts of enabled content types that states when comments will be closed.'),
-        );
+  $form['comment']['commentcloser']['commentcloser_age']['commentcloser_comment_limit'] = array(
+    '#type' => 'textfield',
+    '#size' => 4,
+    '#maxlength' => 4,
+    '#field_suffix' => t('comments'),
+    '#default_value' => variable_get("commentcloser_comment_limit_$type", 0),
+    '#prefix' => '<div style="margin: 0 0 0 4em;">',
+    '#suffix' => '</div>',
+    '#description' => t('If the post receives this many comments, close off further commenting. Leave this at zero (0) for no limit.'),
+  );
 
-      // Add our submit handler in front of node's.
-      array_unshift($form['#submit'], '_comment_closer_handle_interval');
+  // *****************************
+  $form['comment']['commentcloser']['commentcloser_notice'] = array(
+    '#type' => 'radios',
+    '#title' => t('Display close notice on posts'),
+    '#options' => $noyes,
+    '#attributes' => array('class' => array('container-inline')),
+    '#default_value' => variable_get("commentcloser_notice_$type", 0),
+    '#description' => t('Checking "yes" will automatically display a notice at the bottom of all posts of enabled content types that states when comments will be closed.'),
+  );
 
-      return;
-  }
 }
 
-function _comment_closer_age_validate($element, &$form_state) {
+function _commentcloser_age_validate($element, &$form_state) {
   $age = $element['#value'];
   if (!is_numeric($age) || $age < 0 || $age != intval($age)) {
     form_error($element, t('The field "Close commenting after" should be a positive integer.'));
