diff --git a/config/global.ini.php b/config/global.ini.php
index 4f6a7764887f0c1baa7c9d9c6c5d9e35ed5c95b5..459b76b709cb703a6073c84b75ab93bfec29d378 100755
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -25,9 +25,8 @@ default			= en
 
 [Plugins]
 Plugins[] 		= PluginsAdmin
-
-;Plugins[] 		= API
-;Plugins[] 		= Widgetize
+Plugins[] 		= API
+Plugins[] 		= Widgetize
 Plugins[] 		= Home
 Plugins[] 		= Actions
 Plugins[] 		= Dashboard
@@ -44,11 +43,13 @@ Plugins[] 		= ExamplePlugin
 Plugins[] 		= Login
 Plugins[] 		= UsersManager
 Plugins[] 		= SitesManager
-
 Plugins[] 		= Installation
 
-[Plugins_LogStats]
-Plugins[] 		= Provider
+[PluginsInstalled]
+PluginsInstalled[] = Login
+PluginsInstalled[] = UsersManager
+PluginsInstalled[] = SitesManager
+PluginsInstalled[] = Installation
 
 [Debug]
 ; if set to true, the archiving process will always be triggered, even if the archive has already been computed
diff --git a/libs/jquery/superfish.js b/libs/jquery/superfish.js
index 1d568831fea88e9b6e634a54ce015def757558d6..a9557b63fd7b31d65483c3ebe4262f1cafa29d40 100644
--- a/libs/jquery/superfish.js
+++ b/libs/jquery/superfish.js
@@ -36,7 +36,16 @@
 				if($(this).find('ul li').size() == 0)
 				{
 					//console.log('clicked sub menu');
+					
+					// case we clicked the submenu
 					$.superfish.currentActiveMenu = $(this).parents('li');
+					
+					// case we clicked the main menu with NO submenu
+					if($.superfish.currentActiveMenu.size() == 0)
+					{
+						//console.log('clicked main menu with no submenu');
+						$.superfish.currentActiveMenu = $(this);
+					}
 				}
 				else
 				{
@@ -63,12 +72,12 @@
 				if (!$$.is('.'+bcClass) ) {
 					menu.sfTimer=setTimeout(function(){
 						
+						// if there is an active menu (a clicked menu)
 						if($.superfish.currentActiveMenu != 'init')
 						{
 							//console.log('showing '); console.log($.superfish.currentActiveMenu.html());
 							$.superfish.currentActiveMenu.siblings('.sfHover').removeClass('sfHover');
 							$.superfish.currentActiveMenu.showSuperfishUl().siblings().hideSuperfishUl();
-							
 						}
 						else
 						{
diff --git a/modules/Config.php b/modules/Config.php
index 137721de2ac6883fb62552b4b337d2833d01830a..9ca8aeec9a6f92c8c0f1d99216c31a7e6ed8442e 100755
--- a/modules/Config.php
+++ b/modules/Config.php
@@ -80,18 +80,31 @@ class Piwik_Config
 //				print("<pre>saving $section => ".var_export($arraySection,true)." <br>");
 				
 				$configFile .= "[$section]\n";
+				echo "array section"; var_dump($arraySection);
+
 				foreach($arraySection as $name => $value)
 				{
-					// kind of hack 
-					// if the value is a simple array
 					if(is_numeric($name))
 					{
-						$name = $section."[]";
+						$name = $section;
+						$value = array($value);
+					}
+					
+					if(is_array($value))
+					{
+						foreach($value as $currentValue)
+						{
+							$configFile .= $name."[] = $currentValue\n";
+						}
+					}
+					else
+					{
+						$configFile .= $name." = $value\n";						
 					}
-					$configFile .= "$name = $value\n";
 				}
 				$configFile .= "\n";
 			}
+
 			chdir($this->correctCwd);
 			file_put_contents($this->getDefaultUserConfigPath(), $configFile );
 			
diff --git a/modules/FrontController.php b/modules/FrontController.php
index d1b9eee6bf06dd415dfd66e9cef51da78ff84c92..8e1ae0af63cc17912ca4ee59c309575bcc3d0ac1 100644
--- a/modules/FrontController.php
+++ b/modules/FrontController.php
@@ -266,11 +266,9 @@ class Piwik_FrontController
 				Piwik::prefixTable('log_profiling'),
 		);
 		
-//		Piwik::dropTables($doNotDrop);
-
-		Piwik::createTables();
-		
-		Piwik_PluginsManager::getInstance()->installPlugins();
+		//Piwik::dropTables($doNotDrop);
+		//Piwik::createTables();
+		//Piwik_PluginsManager::getInstance()->installPlugins();
 		
 		// Setup the auth object
 		Piwik_PostEvent('FrontController.authSetCredentials');
@@ -279,7 +277,7 @@ class Piwik_FrontController
 			$authAdapter = Zend_Registry::get('auth');
 		}
 		catch(Exception $e){
-			throw new Exception("Object 'auth' cannot be found in the Registry. Maybe the Login plugin is not available?");
+			throw new Exception("Object 'auth' cannot be found in the Registry. Maybe the Login plugin is not enabled?");
 		}
 		
 		// Perform the authentication query, saving the result
diff --git a/modules/LogStats.php b/modules/LogStats.php
index d4e488b92daf9f3ba517558f2fc06d074dab2191..bc167b37f6cb448c3b407702c3f9d65ebd249f7c 100644
--- a/modules/LogStats.php
+++ b/modules/LogStats.php
@@ -84,9 +84,12 @@ class Piwik_LogStats
 
 	private function initProcess()
 	{
-		Piwik_PluginsManager::getInstance()->setPluginsToLoad( 
-				Piwik_LogStats_Config::getInstance()->Plugins_LogStats['Plugins']
-			);
+		$pluginsLogStats = Piwik_LogStats_Config::getInstance()->Plugins_LogStats;
+		if(is_array($pluginsLogStats)
+			&& count($pluginsLogStats) != 0)
+		{
+			Piwik_PluginsManager::getInstance()->setPluginsToLoad( $pluginsLogStats['Plugins_LogStats'] );
+		}
 		
 		$saveStats = Piwik_LogStats_Config::getInstance()->LogStats['record_statistics'];
 		
diff --git a/modules/PluginsManager.php b/modules/PluginsManager.php
index 782ebadd0c43e67303a12594cd92f7db30120e78..f6f038e945acebe9a02732205f919324dc2e041b 100644
--- a/modules/PluginsManager.php
+++ b/modules/PluginsManager.php
@@ -88,28 +88,78 @@ class Piwik_PluginsManager
 	public function deactivatePlugin($pluginName)
 	{
 		$plugins = $this->pluginsToLoad;
-		
+	
 		$key = array_search($pluginName,$plugins);
 		if($key !== false)
 		{
 			unset($plugins[$key]);
 			Zend_Registry::get('config')->Plugins = $plugins;
 		}
+		
+		$pluginsLogStats = Zend_Registry::get('config')->Plugins_LogStats->Plugins_LogStats;
+		if(!is_null($pluginsLogStats))
+		{
+			$pluginsLogStats = $pluginsLogStats->toArray();
+			$key = array_search($pluginName,$pluginsLogStats);
+			if($key !== false)
+			{
+				unset($pluginsLogStats[$key]);
+				Zend_Registry::get('config')->Plugins_LogStats = $pluginsLogStats;
+			}
+		}
 	}
 	public function activatePlugin($pluginName)
 	{
+		$plugins = Zend_Registry::get('config')->Plugins->Plugins->toArray();
+		if(in_array($pluginName,$plugins))
+		{
+			throw new Exception("Plugin '$pluginName' already activated.");
+		}
+		
 		$existingPlugins = $this->readPluginsDirectory();
+		if( array_search($pluginName,$existingPlugins) === false)
+		{
+			throw new Exception("Unable to find the plugin '$pluginName'.");
+		}
 		
-		if( array_search($pluginName,$existingPlugins) !== false)
+		$plugin = $this->loadPlugin($pluginName);
+		
+		// is the plugin already installed or is it the first time we activate it?
+		$pluginsInstalled = Zend_Registry::get('config')->PluginsInstalled->PluginsInstalled->toArray();
+		if(!in_array($pluginName,$pluginsInstalled))
 		{
-			$plugins = Zend_Registry::get('config')->Plugins->Plugins->toArray();
-			
-			$plugins[] = $pluginName;
+			$this->installPlugin($plugin);
+			$pluginsInstalled[] = $pluginName;
+			Zend_Registry::get('config')->PluginsInstalled = $pluginsInstalled;	
+		}
+		
+		$information = $plugin->getInformation();
+		
+		// if the plugin is to be loaded during the statistics logging
+		if(isset($information['LogStatsPlugin'])
+			&& $information['LogStatsPlugin'] === true)
+		{
+			$pluginsLogStats = Zend_Registry::get('config')->Plugins_LogStats->Plugins_LogStats;
+			if(is_null($pluginsLogStats))
+			{
+				$pluginsLogStats = array();
+			}
+			else
+			{
+				$pluginsLogStats = $pluginsLogStats->toArray();
+			}
+			$pluginsLogStats[] = $pluginName;
+
+			// the config file will automatically be saved with the new plugin
+			Zend_Registry::get('config')->Plugins_LogStats = $pluginsLogStats;
 			
-			$plugins = array_unique($plugins);
-//			var_dump($plugins);exit;
-			Zend_Registry::get('config')->Plugins = $plugins;
 		}
+		
+		// we add the plugin to the list of activated plugins
+		$plugins[] = $pluginName;
+
+		// the config file will automatically be saved with the new plugin
+		Zend_Registry::get('config')->Plugins = $plugins;
 	}
 	
 	public function setPluginsToLoad( array $pluginsToLoad )
@@ -172,6 +222,7 @@ class Piwik_PluginsManager
 	 */
 	public function loadPlugins()
 	{
+		$this->pluginsToLoad = array_unique($this->pluginsToLoad);
 		foreach($this->pluginsToLoad as $pluginName)
 		{
 			$newPlugin = $this->loadPlugin($pluginName);
@@ -226,6 +277,15 @@ class Piwik_PluginsManager
 		}
 		return $newPlugin;
 	}
+
+	public function installPlugin( Piwik_Plugin $plugin )
+	{
+		try{
+			$plugin->install();
+		} catch(Exception $e) {
+			throw new Exception("There was a problem installing the plugin ". $plugin->getName() . " = " . $e->getMessage() );
+		}	
+	}
 	
 	public function installPlugins()
 	{
diff --git a/plugins/Home/Controller.php b/plugins/Home/Controller.php
index 235f71eab7b21e28635daac66844a217bca006ea..2e86d3a116f8e4dd16185ba8904b211bfdcb4d3a 100644
--- a/plugins/Home/Controller.php
+++ b/plugins/Home/Controller.php
@@ -34,7 +34,7 @@ class Piwik_Home_Controller extends Piwik_Controller
 		// date
 		$view->date = $this->strDate;
 		$oDate = new Piwik_Date($this->strDate);
-		$view->prettyDate = $oDate->get("l jS F Y");
+		$view->prettyDate = $oDate->get("l j\<\s\u\p\>S\<\/\s\u\p\> F Y");
 		
 		// period
 		$currentPeriod = Piwik_Common::getRequestVar('period');
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php
index 0a2301c0414c9cd9fad235ec09aa5f3b57096484..809f44b2c8c248422d367b76b663abb19b2f2082 100644
--- a/plugins/Provider/Provider.php
+++ b/plugins/Provider/Provider.php
@@ -23,6 +23,7 @@ class Piwik_Provider extends Piwik_Plugin
 			'author' => 'Piwik',
 			'homepage' => 'http://piwik.org/',
 			'version' => '0.1',
+			'LogStatsPlugin' => true, // this plugin must be loaded during the stats logging
 		);
 		
 		return $info;
@@ -151,7 +152,6 @@ class Piwik_Provider extends Piwik_Plugin
 	
 }
 
-
 // when the plugin is loaded during LogStats these functions are not defined
 if(function_exists('Piwik_AddWidget'))
 {