diff --git a/userpoints_reset/userpoints_reset.info b/userpoints_reset/userpoints_reset.info
old mode 100755
new mode 100644
diff --git a/userpoints_retroactive/userpoints_retroactive.info b/userpoints_retroactive/userpoints_retroactive.info
old mode 100755
new mode 100644
index 5206778..ad1b707
--- a/userpoints_retroactive/userpoints_retroactive.info
+++ b/userpoints_retroactive/userpoints_retroactive.info
@@ -1,6 +1,5 @@
 name = Userpoints Retroactive
 description = Calculate userpoints for nodes and comments created so far.
 package = Userpoints
-core = 6.x
-dependencies[] = userpoints
-dependencies[] = not_compatible_with_d7
+core = 7.x
+dependencies[] = userpoints
\ No newline at end of file
diff --git a/userpoints_retroactive/userpoints_retroactive.module b/userpoints_retroactive/userpoints_retroactive.module
index d24fb4c..e0a41b0 100644
--- a/userpoints_retroactive/userpoints_retroactive.module
+++ b/userpoints_retroactive/userpoints_retroactive.module
@@ -2,37 +2,36 @@
 
 // Based on a script by Miguel Figueiredo <elmig@debianpt.org>, 2006
 
-define(USERPOINTS_PERM_RETROACTIVE, 'retroactive userpoints');
+define('USERPOINTS_POST', 'userpoints_post_');
 
 function userpoints_retroactive_help($path, $arg) {
   switch ($path) {
-    case 'admin/settings/userpoints/retroactive':
-      $output = t('Award users !points for nodes, comments and votes they created in the past.', userpoints_translation());
-      break;
+    case 'admin/config/people/userpoints/retroactive':
+      return t('Award users !points for nodes, comments and votes they created in the past.', userpoints_translation());
   }
-  return $output;
 }
 
 function userpoints_retroactive_menu() {
-  $items['admin/settings/userpoints/retroactive'] = array(
-    'page callback'    => 'userpoints_retroactive_page',
+  $items['admin/config/people/userpoints/retroactive'] = array(
     'title'            => t('Retroactive'),
-    'access arguments' => array(USERPOINTS_PERM_RETROACTIVE),
-    'type'             => MENU_NORMAL_ITEM
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('userpoints_retroactive_form'),
+    'access arguments' => array('retroactive userpoints'),
+    'type'             => MENU_LOCAL_TASK,
   );
 
   return $items;
 }
 
-function userpoints_retroactive_perm() {
-  return array (USERPOINTS_PERM_RETROACTIVE);
-}
-
-function userpoints_retroactive_page() {
-  return drupal_get_form('userpoints_retroactive', $form);
+function userpoints_retroactive_permission() {
+  return array(
+    'retroactive userpoints' => array(
+      'title' => t('Administer retroactive userpoints module'),
+    ),
+  );
 }
 
-function userpoints_retroactive() {
+function userpoints_retroactive_form($form, $form_state) {
   $form = array();
   
   $form['confirm'] = array(
@@ -51,11 +50,11 @@ function userpoints_retroactive() {
   return $form;
 }
 
-function userpoints_retroactive_submit($form, &$form_state) {
+function userpoints_retroactive_form_submit($form, &$form_state) {
   if ($form_state['values']['confirm'] == t('YES')) {
     userpoints_retroactive_do();
     drupal_set_message(t('Retroactive !points awarded.', userpoints_translation()));
-    drupal_goto('admin/settings/userpoints');
+    drupal_goto('admin/config/people/userpoints');
   }
 }
 
@@ -75,7 +74,7 @@ function userpoints_retroactive_do() {
 function userpoints_retroactive_nodes() {
   $num = 0;
   $result = db_query("SELECT uid, type, COUNT(uid) AS val FROM {node} WHERE status = 1 AND uid > 0 GROUP BY uid, type");
-  while($node = db_fetch_object($result)) {
+  foreach ($result as $node) {
     $weight = variable_get(USERPOINTS_POST . $node->type, 0);
     $tid = variable_get(USERPOINTS_POST . $node->type . '_category', 0);
     $params = array(
@@ -96,8 +95,8 @@ function userpoints_retroactive_comments() {
   $num = 0;
   $weight = variable_get(USERPOINTS_POST_COMMENT, 0);
   $tid = variable_get(USERPOINTS_POST_COMMENT . '_category', 0);
-  $result = db_query('SELECT uid, COUNT(uid) AS val FROM {comments} WHERE status = 0 AND uid > 0 GROUP BY uid');
-  while($comment = db_fetch_object($result)) {
+  $result = db_query('SELECT uid, COUNT(uid) AS val FROM {comment} WHERE status = 0 AND uid > 0 GROUP BY uid');
+  foreach ($result as $comment) {
     $params = array(
       'uid'       => $comment->uid,
       'tid'       => $tid,
