diff --git a/views/views-rss-fields-item.tpl.php b/views/views-rss-fields-item.tpl.php
deleted file mode 100644
index 47ca842..0000000
--- a/views/views-rss-fields-item.tpl.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php // $Id$ ?>
-<item>
-  <?php print $row ?>
-</item>
diff --git a/views/views-view-views-rss-fields.tpl.php b/views/views-view-views-rss-fields.tpl.php
index fb9ee1e..1fb854b 100644
--- a/views/views-view-views-rss-fields.tpl.php
+++ b/views/views-view-views-rss-fields.tpl.php
@@ -1,4 +1,3 @@
-<?php // $Id$ ?>
 <?php print "<?xml"; ?> version="1.0" encoding="utf-8" <?php print "?>"; ?>
 
 <rss version="2.0" <?php print $namespaces ?>>
diff --git a/views/views_plugin_style_rss_fields.inc b/views/views_plugin_style_rss_fields.inc
index 878901b..f920181 100644
--- a/views/views_plugin_style_rss_fields.inc
+++ b/views/views_plugin_style_rss_fields.inc
@@ -29,35 +29,34 @@ class views_plugin_style_rss_fields extends views_plugin_style {
         $this->view->feed_icon = '';
       }
 
-      $this->view->feed_icon .= theme('feed_icon', $url, $title);
+      $this->view->feed_icon .= theme('feed_icon', array('url' => $url, 'title' => $title));
       drupal_add_link(array(
         'rel' => 'alternate',
         'type' => 'application/rss+xml',
         'title' => $title,
-        'href' => $url
+        'href' => $url,
       ));
     }
   }
-  
-  
+
   function option_definition() {
     $options = parent::option_definition();
 
     $options['description'] = array(
       'contains' => array(
-        'feed_description' => array('default' => ''),
+        'feed_description' => array('default' => '', 'translatable' => TRUE),
       ),
     );
-    
+
     $field_options = array();
     foreach ($this->xml_fields() as $k => $option) {
       $field_options[$k] = array('default' => '');
     }
-    
+
     $options['fields'] = array(
       'contains' => $field_options,
     );
-    
+
     $options['georss'] = array(
       'contains' => array(
         'lat' => array('default' => ''),
@@ -65,7 +64,7 @@ class views_plugin_style_rss_fields extends views_plugin_style {
         'featureName' => array('default' => ''),
       ),
     );
-    
+
     return $options;
   }
 
@@ -77,7 +76,6 @@ class views_plugin_style_rss_fields extends views_plugin_style {
    */
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
-    $options = parent::option_definition();
 
     $handlers = $this->display->handler->get_handlers('field');
     if (empty($handlers)) {
@@ -167,8 +165,27 @@ class views_plugin_style_rss_fields extends views_plugin_style {
     $keys = array_keys($this->view->field);
 
     foreach ($rows as $count => $row) {
+      $this->view->row_index = $count;
       foreach ($keys as $id) {
-        $renders[$count][$id] = $this->view->field[$id]->theme($row);
+        $field = $this->view->field[$id];
+
+        // Wut, wuuuut??? crazy, yeah, but tere is no solid way of getting raw
+        // query result data.
+        // See: http://drupal.org/node/1172970
+        if ($field->field_alias == 'nid') {
+          $field_alias = 'field_' . $field->field;
+        }
+        else {
+          $field_alias = $field->field_alias;
+        }
+        $renders[$count][$id]['#markup'] = $field->theme($row);
+
+        // Link field causes problems.
+        // Maybe this whole map_rows thing isn't the right way to go.
+        // Do we need a custom row plugin?
+        if ($field_alias != 'unknown') {
+          $renders[$count][$id]['#raw'] = $row->{$field_alias};
+        }
       }
     }
 
@@ -176,8 +193,9 @@ class views_plugin_style_rss_fields extends views_plugin_style {
     foreach ($renders as $id => $row) {
       $item = array();
       foreach (array_merge($this->options['fields'], $this->options['georss']) as $key => $val) {
-        if (!isset($this->view->field[$val])) continue;
-        $item[$key] = $row[$val];
+        if (isset($this->view->field[$val])) {
+          $item[$key] = $row[$val];
+        }
       }
       $items[] = $item;
     }
@@ -221,6 +239,10 @@ class views_plugin_style_rss_fields extends views_plugin_style {
         'title' => t('pubDate'),
         'description' => t('RSS 2.0 pubDate element'),
       ),
+      'enclosure' => array(
+        'title' => t('enclosure'),
+        'description' => t('RSS 2.0 enclosure element'),
+      ),
     );
   }
 
@@ -258,4 +280,4 @@ class views_plugin_style_rss_fields extends views_plugin_style {
     }
     return FALSE;
   }
-}
\ No newline at end of file
+}
diff --git a/views/views_rss.views.inc b/views/views_rss.views.inc
index ac2afec..65279f7 100644
--- a/views/views_rss.views.inc
+++ b/views/views_rss.views.inc
@@ -6,7 +6,8 @@
  */
 
 /**
- * Implementation of hook_views_style_plugins(). Adds view types to views UI interface.
+ * Implements hook_views_style_plugins(). 
+ * Adds view types to views UI interface().
  */
 function views_rss_views_plugins() {
   return array(
@@ -17,8 +18,8 @@ function views_rss_views_plugins() {
         'handler' => 'views_plugin_style_rss_fields',
         'theme' => 'views_view_views_rss_fields',
         'theme file' => 'views_rss_views_fields.theme.inc',
-        'theme path' => drupal_get_path('module', 'views_rss') .'/views',
-        'path' => drupal_get_path('module', 'views_rss') .'/views',
+        'theme path' => drupal_get_path('module', 'views_rss') . '/views',
+        'path' => drupal_get_path('module', 'views_rss') . '/views',
         'uses row plugin' => FALSE,
         'uses fields' => TRUE,
         'uses options' => TRUE,
diff --git a/views/views_rss_views_fields.theme.inc b/views/views_rss_views_fields.theme.inc
index f81bd0d..7ae8032 100644
--- a/views/views_rss_views_fields.theme.inc
+++ b/views/views_rss_views_fields.theme.inc
@@ -24,7 +24,7 @@ function template_preprocess_views_view_views_rss_fields(&$vars) {
   else {
     $description = variable_get('site_mission', '');
   }
-  $vars['description'] = theme('views_rss_feed_description', $description, $view);
+  $vars['description'] = theme('views_rss_feed_description', array('0' => $description, '1' => $view));
 
   // Base URL for link tag
   global $base_url;
@@ -34,18 +34,18 @@ function template_preprocess_views_view_views_rss_fields(&$vars) {
   $elements = $namespaces = array();
   $rows = '';
   $items = $view->style_plugin->map_rows($vars['rows']);
-  foreach($items as $item) {
+  foreach ($items as $item) {
     // Special handling for GeoRSS.
-    if (is_numeric($item['lat']) && is_numeric($item['lon'])) {
-      $item['georss:point'] = $item['lat'] .' '.  $item['lon'];
+    if (isset($item['lat']) && is_numeric($item['lat']) && isset($item['lon']) && is_numeric($item['lon'])) {
+      $item['georss:point'] = $item['lat'] . ' ' .  $item['lon'];
     }
-    if(isset($item['featureName'])) {
+    if (isset($item['featureName'])) {
       $item['georss:featureName'] = $item['featureName'];
     }
     unset($item['lat']);
     unset($item['lon']);
     unset($item['featureName']);
-    $rows .= theme('views_rss_fields_item', $item);
+    $rows .= theme('views_rss_fields_item', array('item' => $item));
     foreach ($item as $k => $v) {
       $elements[$k] = $k;
     }
@@ -59,38 +59,78 @@ function template_preprocess_views_view_views_rss_fields(&$vars) {
   $vars['namespaces'] = implode(' ', array_unique($namespaces));
 
   // Set Headers
-  drupal_set_header('Content-Type: application/rss+xml; charset=utf-8');
+  // During live preview we don't want to output the header since the contents
+  // of the feed are being displayed inside a normal HTML page.
+  if (empty($vars['view']->live_preview)) {
+    drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8');
+  }
 }
 
 /**
- * Template preprocessor for views-rss-fields-item.tpl.php.
+ * Element template
  */
-function template_preprocess_views_rss_fields_item(&$vars) {
-  $item = $vars['item'];
-
+function theme_views_rss_fields_item($variables) {
+  $item = $variables['item'];
   // Loop through key=>value pairs
   $row = '';
   foreach ($item as $key => $value) {
     if ($value) {
-      $row .= "<$key>". check_plain(htmlspecialchars_decode($value)) ."</$key>\n";
+      $row .= theme('views_rss_fields_element', array('key' => $key, 'element' => $value));
     }
   }
+  return '<item>' . $row . '</item>';
+}
+
+/**
+ * Element template
+ */
+function theme_views_rss_fields_element($variables) {
+  $key = $variables['key'];
+  $value = $variables['element'];
 
-  $vars['row'] = $row;
+  if ($key == 'enclosure') {
+    // file exists
+    if (isset($value['#raw'][0])) {
+      $file = (array)$value['#raw'][0]['raw'];
+      // Media field
+      if (isset($value['#raw'][0]['rendered']['file']['#entity_type']) &&
+          $value['#raw'][0]['rendered']['file']['#entity_type'] == 'media') {
+        $style = str_replace("styles_file_", "", $value['#raw'][0]['rendered']['file']['#formatter']);
+        $url = image_style_url($style, $file['uri']);
+      }
+      // Image field
+      else if (isset($value['#raw'][0]['rendered']['#image_style'])) {
+        $url = image_style_url($value['#raw'][0]['rendered']['#image_style'], $file['uri']);
+      }
+      // File field
+      else {
+        $url = file_create_url($file['uri']);
+      }
+      return '<enclosure url="' . $url . '" length="' . $file['filesize'] . '" type="' . $file['filemime'] . '" />';
+    }
+  }
+  else {
+    return "<$key>" . check_plain(htmlspecialchars_decode($value['#markup'])) . "</$key>";
+  }
 }
 
 /**
  * Theme function for feed icon.
  */
-function theme_views_rss_feed_icon($url, $title, $icon) {
-  if ($image = theme('image', $icon, t('Download RSS Feed'), $title)) {
-    return '<a href="'. check_url($url) .'" class="feed-icon">'. $image .'</a>';
+function theme_views_rss_feed_icon($variables) {
+  $url = $variables['0'];
+  $title = $variables['1'];
+  $icon = $variables['2'];
+  if ($image = theme('image', array('path' => $icon, 'width' => t('Download RSS Feed'), 'height' => $title))) {
+    return '<a href="' . check_url($url) . '" class="feed-icon">' . $image . '</a>';
   }
 }
 
 /**
  * Theme function for feed description.
  */
-function theme_views_rss_feed_description($description, $view) {
+function theme_views_rss_feed_description($variables) {
+  $description = $variables['0'];
+  $view = $variables['1'];
   return $description;
 }
diff --git a/views_rss.info b/views_rss.info
index 80b4785..edbc2a6 100644
--- a/views_rss.info
+++ b/views_rss.info
@@ -2,4 +2,5 @@ name = "Views RSS"
 description = "Provides views plugin for that allows RSS Feeds from Views to be use fields"
 package = "Views Bonus Pack"
 dependencies[] = views
-core = "6.x"
\ No newline at end of file
+core = 7.x
+
diff --git a/views_rss.module b/views_rss.module
index 3c49f81..43b7882 100644
--- a/views_rss.module
+++ b/views_rss.module
@@ -1,36 +1,40 @@
 <?php
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function views_rss_views_api() {
   return array(
-    'api' => 2,
-    'path' => drupal_get_path('module', 'views_rss') .'/views',
+    'api' => 3,
+    'path' => drupal_get_path('module', 'views_rss') . '/views',
   );
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function views_rss_theme() {
   $path = drupal_get_path('module', 'views_rss');
   return array(
     'views_rss_fields_item' => array(
-      'arguments' => array('item' => array()),
+      'variables' => array('item' => NULL),
       'file' => 'views_rss_views_fields.theme.inc',
-      'template' => 'views-rss-fields-item',
       'path' => "$path/views",
     ),
-   'views_rss_feed_icon' => array(
-      'arguments' => array('url', 'title', 'icon'),
+    'views_rss_fields_element' => array(
+      'variables' => array('key' => NULL, 'element' => NULL),
+      'file' => 'views_rss_views_fields.theme.inc',
+      'path' => "$path/views",
+    ),
+    'views_rss_feed_icon' => array(
+      'variables' => array('url', 'title', 'icon'),
       'file' => 'views_rss_views_fields.theme.inc',
       'path' => "$path/views",
     ),
     'views_rss_feed_description' => array(
-       'arguments' => array('description', 'view'),
-       'file' => 'views_rss_views_fields.theme.inc',
-       'path' => "$path/views",
-     ),
+      'variables' => array('description', 'view'),
+      'file' => 'views_rss_views_fields.theme.inc',
+      'path' => "$path/views",
+    ),
   );
 }
