diff --git a/views_tree.info b/views_tree.info
index 6c9c0c0..b9ee29c 100644
--- a/views_tree.info
+++ b/views_tree.info
@@ -1,5 +1,14 @@
 name = Views Tree
 description = A Views style plugin to display a tree of elements using the adjacency model.
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
+files[] = views_tree_plugin_style_tree.inc
+
+; Information added by drupal.org packaging script on 2011-02-25
+
+;version = "6.x-2.x-dev"
+;core = "6.x"
+;project = "views_tree"
+;datestamp = "1298620671"
+
diff --git a/views_tree.module b/views_tree.module
index 6ff4fca..92538b6 100644
--- a/views_tree.module
+++ b/views_tree.module
@@ -15,8 +15,16 @@ function views_tree_views_api() {
  */
 function views_tree_theme($existing, $type, $theme, $path) {
   return array(
+    'views_tree' => array(
+      'variables' => array(
+        'view' => NULL,
+        'options' => array(),
+        'rows' => array(),
+        'title' => NULL,
+      ),
+    ),
     'views_tree_inner' => array(
-      'arguments' => array(
+      'variables' => array(
         'view' => NULL,
         'options' => array(),
         'rows' => array(),
@@ -37,7 +45,12 @@ function views_tree_theme($existing, $type, $theme, $path) {
  * @ingroup themeable
  * @link http://drupal.org/node/355919
  */
-function theme_views_tree($view, $options, $rows, $title) {
+function theme_views_tree($variables) {
+  $view = $variables['view'];
+  $options = $variables['options'];
+  $rows = $variables['rows'];
+  $title = $variables['title'];
+
   $result = $view->result;
   $fields = &$view->field;
 
@@ -56,7 +69,16 @@ function theme_views_tree($view, $options, $rows, $title) {
     }
   }
 
-  return $title . theme('views_tree_inner', $view, $options, $rows, $title, $result, 0);
+  return $title . theme('views_tree_inner',
+                        array(
+                          'view' => $view,
+                          'options' => $options,
+                          'rows' => $rows,
+                          'title' => $title,
+                          'result' => $result,
+                          'parent' => 0,
+                        )
+  );
 }
 
 /**
@@ -72,12 +94,20 @@ function theme_views_tree($view, $options, $rows, $title) {
  * @param $parent
  *   The id of the parent entry in the call stack.
  */
-function theme_views_tree_inner($view, $options, $rows, $title, $result, $parent = NULL) {
+function theme_views_tree_inner($variables) {
+  $view = $variables['view'];
+  $options = $variables['options'];
+  $rows = $variables['rows'];
+  $title = $variables['title'];
+  $result = $variables['result'];
+  $parent = $variables['parent'];
+
   $items = array();
   foreach ($result as $i => $record) {
     if ($record->$options['parent_field_property'] == $parent) {
-      $items[] = $rows[$i] . call_user_func(__FUNCTION__, $view, $options, $rows, $title, $result, $record->$options['main_field_property']);
+      $variables['parent'] = $record->$options['main_field_property'];
+      $items[] = $rows[$i] . call_user_func(__FUNCTION__, $variables);
     }
   }
-  return count($items) ? theme('item_list', $items, NULL, $options['type']) : '';
+  return count($items) ? theme('item_list', array('items' => $items, 'type' => $options['type'])) : '';
 }
diff --git a/views_tree.views.inc b/views_tree.views.inc
index a30eeb2..2e88222 100644
--- a/views_tree.views.inc
+++ b/views_tree.views.inc
@@ -4,25 +4,24 @@
  * Implementation of hook_views_plugins()
  */
 function views_tree_views_plugins() {
-  $path = drupal_get_path('module', 'views_tree');
-
-  return array(
+  $plugin = array(
     'style' => array(
       'tree' => array(
-        'title'           => t('Tree (Adjacency model)'),
-        'help'            => t('Display the results as a nested tree'),
-        'handler'         => 'views_tree_plugin_style_tree',
-        'uses options'    => TRUE,
+        'title' => t('Tree (Adjacency model)'),
+        'help' => t('Display the results as a nested tree'),
+        'handler' => 'views_tree_plugin_style_tree',
+        'theme' => 'views_tree',
+        'uses options' => TRUE,
         'uses row plugin' => TRUE,
-        'uses fields'     => TRUE,
-        'uses grouping'   => FALSE,
-        'type'            => 'normal',
-        'parent'          => 'list',
-        'path'            => drupal_get_path('module', 'views_tree'),
-        'theme'           => 'views_tree',
-        'theme path'      => drupal_get_path('module', 'views_tree'),
+        'uses fields' => TRUE,
+        'uses grouping' => FALSE,
+        'type' => 'normal',
+        'parent' => 'list',
+        //'path' => drupal_get_path('module', 'views_tree'),
       ),
     ),
   );
+
+  return $plugin;
 }
 
diff --git a/views_tree_plugin_style_tree.inc b/views_tree_plugin_style_tree.inc
index 0a3207b..dbd3da9 100644
--- a/views_tree_plugin_style_tree.inc
+++ b/views_tree_plugin_style_tree.inc
@@ -17,7 +17,6 @@ class views_tree_plugin_style_tree extends views_plugin_style_list {
    */
   function option_definition() {
     $options = parent::option_definition();
-
     $options['main_field'] = array('default' => '');
     $options['parent_field'] = array('default' => '');
 
@@ -29,7 +28,7 @@ class views_tree_plugin_style_tree extends views_plugin_style_list {
    */
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
-    watchdog(WATCHDOG_DEBUG, __FILE .': '. __LINE__);
+
     $fields = array('' => t('<None>'));
 
     foreach ($this->display->handler->get_handlers('field') as $field => $handler) {
