diff --git a/Makefile b/Makefile
index 26d48e5d69b7c99ee6e645c411a21fe0b07d192f..7dbb77aec4a0203110a20bb0ebc0a4d68427a4e4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,13 @@
 BASE=downloads_for_sale
 PLUGINTYPE=vmcustom
-VERSION=1.6
+VERSION=1.7
 
 PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html
 
 TRANSLATIONS=$(call wildcard,language/*/*.plg_$(PLUGINTYPE)_$(BASE).*ini) 
 INDEXFILES=$(BASE)/index.html language/index.html $(call wildcard,language/*/index.html)
 ELEMENTS=$(call wildcard,elements/*.php) elements/index.html
+FIELDS=$(call wildcard,fields/*.php) fields/index.html
 TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) $(BASE)/index.html $(BASE)/tmpl/index.html
 ASSETS=$(call wildcard,$(BASE)/assets/*.png) $(call wildcard,$(BASE)/assets/*.css) $(BASE)/assets/index.html
 ZIPFILE=plg_$(PLUGINTYPE)_$(BASE)_v$(VERSION).zip
@@ -14,7 +15,7 @@ ZIPFILE=plg_$(PLUGINTYPE)_$(BASE)_v$(VERSION).zip
 
 zip: $(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(TMPLFILES)
 	@echo "Packing all files into distribution file $(ZIPFILE):"
-	@zip -r $(ZIPFILE) $(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(INDEXFILES) $(TMPLFILES) $(ASSETS)
+	@zip -r $(ZIPFILE) $(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(FIELDS) $(INDEXFILES) $(TMPLFILES) $(ASSETS)
 
 clean:
 	rm -f $(ZIPFILE)
diff --git a/downloads_for_sale.php b/downloads_for_sale.php
index bf70cc4177533c8bfe15cdc5dd2b941acae9842b..b3ea3bac5643a8178e631a029ff8c6a4686ac16b 100644
--- a/downloads_for_sale.php
+++ b/downloads_for_sale.php
@@ -627,8 +627,8 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
 		return true;
 	}
 
-	function plgVmSetOnTablePluginParamsCustom($name, $id, &$table,$xParams){
-		return $this->setOnTablePluginParams($name, $id, $table, $xParams);
+	function plgVmSetOnTablePluginParamsCustom($name, $id, &$table){
+		return $this->setOnTablePluginParams($name, $id, $table);
 	}
 
 
diff --git a/downloads_for_sale.script.php b/downloads_for_sale.script.php
index 104e717782d72a6e5eaa434cfe57fb03d4507012..35cc19b928fa0bd6aed86d4d5ee607ebbd587139 100644
--- a/downloads_for_sale.script.php
+++ b/downloads_for_sale.script.php
@@ -46,7 +46,7 @@ class plgVmCustomDownloads_for_SaleInstallerScript
     public function install(JAdapterInstance $adapter)
     {
         // enabling plugin
-        $db =& JFactory::getDBO();
+        $db = JFactory::getDBO();
         $db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "downloads_for_sale" and folder = "vmcustom"');
         $db->query();
         
diff --git a/downloads_for_sale.xml b/downloads_for_sale.xml
index 7624e836cc1693101cebffe8c4ec5d2487d6e517..e815328932f64bb8598a892d22e1d0ae50eef46d 100644
--- a/downloads_for_sale.xml
+++ b/downloads_for_sale.xml
@@ -6,7 +6,7 @@
     <authorUrl>http://www.open-tools.net/</authorUrl>
     <copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright>
     <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license>
-    <version>1.6</version>
+    <version>1.7</version>
     <description>VMCUSTOM_DLSALE_DESC</description>
     <files>
         <filename plugin="downloads_for_sale">downloads_for_sale.php</filename>
diff --git a/downloads_for_sale/tmpl/downloads.php b/downloads_for_sale/tmpl/downloads.php
index a6188f38999e0766100e5dc93933f379c2387109..27973fd1790f69394082033641ef31b3cdaf853d 100644
--- a/downloads_for_sale/tmpl/downloads.php
+++ b/downloads_for_sale/tmpl/downloads.php
@@ -12,7 +12,7 @@
 defined('_JEXEC') or die();
 
 if(JFile::exists(VMDLSALE_PLUGINPATH.DS.'downloads_for_sale'.DS.'assets'.DS.'downloads_for_sale.css')) {
-	$doc =& JFactory::getDocument();
+	$doc = JFactory::getDocument();
 	$doc->addStyleSheet(JURI::root().VMDLSALE_PLUGINWEBROOT.'/downloads_for_sale/assets/downloads_for_sale.css');  
 }
 ?>
diff --git a/downloads_for_sale/tmpl/order_long.php b/downloads_for_sale/tmpl/order_long.php
index de529c3fdf0f472a17644bdabacfa17a3215c626..f282689ae7f60fc56e8b649411ee9c1dd9b26a68 100644
--- a/downloads_for_sale/tmpl/order_long.php
+++ b/downloads_for_sale/tmpl/order_long.php
@@ -11,7 +11,7 @@
  
 defined('_JEXEC') or die();
 if(JFile::exists(VMDLSALE_PLUGINPATH.DS.'downloads_for_sale'.DS.'assets'.DS.'downloads_for_sale.css')) {
-	$doc =& JFactory::getDocument();
+	$doc = JFactory::getDocument();
 	$doc->addStyleSheet(JURI::root().VMDLSALE_PLUGINWEBROOT.'/downloads_for_sale/assets/downloads_for_sale.css');  
 }
 ?>
diff --git a/downloads_for_sale/tmpl/product_long.php b/downloads_for_sale/tmpl/product_long.php
index ec77c91bdbf6454dfd21d179a75d008202cf7a8b..a6dbac92fd8f6641c8fbd06edfcef040cf7352d1 100644
--- a/downloads_for_sale/tmpl/product_long.php
+++ b/downloads_for_sale/tmpl/product_long.php
@@ -12,7 +12,7 @@
 defined('_JEXEC') or die();
 
 if(JFile::exists(VMDLSALE_PLUGINPATH.DS.'downloads_for_sale'.DS.'assets'.DS.'downloads_for_sale.css')) {
-	$doc =& JFactory::getDocument();
+	$doc = JFactory::getDocument();
 	$doc->addStyleSheet(JURI::root().VMDLSALE_PLUGINWEBROOT.'/downloads_for_sale/assets/downloads_for_sale.css');  
 }
 ?>
diff --git a/releases/plg_vmcustom_downloads_for_sale_v1.7.zip b/releases/plg_vmcustom_downloads_for_sale_v1.7.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ffb8374c298b8a74a6c9f445173c228c18173947
Binary files /dev/null and b/releases/plg_vmcustom_downloads_for_sale_v1.7.zip differ