diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3dbc36fb2b45953c8d94723f465fa2f9a7b90a6..bffb99c177e10573bd54b12d8f716c547450b59d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,7 @@ IF(\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\" )
 ELSE(\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\" )
   IF(${CMAKE_BUILD_TYPE} STREQUAL DEBUG)
     SET(${PROJECT_NAME}_CXXFLAGS ${CMAKE_CXX_FLAGS_DEBUG}) # Useless since CXX_FLAGS, not CXXFLAGS.
+    ADD_DEFINITIONS(-DVP_DEBUG -DVP_DEBUG_MODE=15)
   ENDIF(${CMAKE_BUILD_TYPE} STREQUAL DEBUG)
   IF(${CMAKE_BUILD_TYPE} STREQUAL RELEASE)
     SET(${PROJECT_NAME}_CXXFLAGS ${CMAKE_CXX_FLAGS_RELEASE}) # Same here.
diff --git a/doc/CMakeFiles/CMakeDirectoryInformation.cmake b/doc/CMakeFiles/CMakeDirectoryInformation.cmake
index 010f0321f01cce7826e905a7552d149d85dcb7b1..fab3cc942406b2c4553310a4baa4a16115f71a9d 100644
--- a/doc/CMakeFiles/CMakeDirectoryInformation.cmake
+++ b/doc/CMakeFiles/CMakeDirectoryInformation.cmake
@@ -2,14 +2,15 @@
 # Generated by "Unix Makefiles" Generator, CMake Version 2.8
 
 # Relative path conversion top directories.
-SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/blue/sot-devel/dynamicGraph")
-SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/blue/sot-devel/dynamicGraph")
+SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/blue/sot-devel/dg")
+SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/blue/sot-devel/dg")
 
 # Force unix paths in dependencies.
 SET(CMAKE_FORCE_UNIX_PATHS 1)
 
 # The C and CXX include file search paths:
 SET(CMAKE_C_INCLUDE_PATH
+  "/usr/local/include"
   )
 SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})
 SET(CMAKE_Fortran_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})
diff --git a/doc/CMakeFiles/documentation.dir/DependInfo.cmake b/doc/CMakeFiles/documentation.dir/DependInfo.cmake
index ac621c52e06b47ffc097cfb71b45dd121c98b7f7..582405bfaad66675186d3068af6045fd2cfd596d 100644
--- a/doc/CMakeFiles/documentation.dir/DependInfo.cmake
+++ b/doc/CMakeFiles/documentation.dir/DependInfo.cmake
@@ -3,6 +3,12 @@ SET(CMAKE_DEPENDS_LANGUAGES
   )
 # The set of files for implicit dependencies of each language:
 
+# Preprocessor definitions for this target.
+SET(CMAKE_TARGET_DEFINITIONS
+  "HAVE_LIBBOOST_THREAD"
+  "HAVE_PTHREAD"
+  )
+
 # Targets to which this target links.
 SET(CMAKE_TARGET_LINKED_INFO_FILES
   )
diff --git a/doc/CMakeFiles/documentation.dir/build.make b/doc/CMakeFiles/documentation.dir/build.make
index 7b353d4a9391c040b5baf2e1f0ae48f6ab776426..d2f95dd0a2a6dc25cf04d9c7c6f1a8974b7490c1 100644
--- a/doc/CMakeFiles/documentation.dir/build.make
+++ b/doc/CMakeFiles/documentation.dir/build.make
@@ -38,19 +38,19 @@ RM = /usr/bin/cmake -E remove -f
 CMAKE_EDIT_COMMAND = /usr/bin/ccmake
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/blue/sot-devel/dynamicGraph
+CMAKE_SOURCE_DIR = /home/blue/sot-devel/dg
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/blue/sot-devel/dynamicGraph
+CMAKE_BINARY_DIR = /home/blue/sot-devel/dg
 
 # Utility rule file for documentation.
 
 doc/CMakeFiles/documentation: doc/html/index.html
 
 doc/html/index.html:
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/blue/sot-devel/dynamicGraph/CMakeFiles $(CMAKE_PROGRESS_1)
+	$(CMAKE_COMMAND) -E cmake_progress_report /home/blue/sot-devel/dg/CMakeFiles $(CMAKE_PROGRESS_1)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold "Generating html/index.html"
-	cd /home/blue/sot-devel/dynamicGraph/doc && /usr/bin/doxygen "/home/blue/sot-devel/dynamicGraph/doc/package.dox"
+	cd /home/blue/sot-devel/dg/doc && /usr/bin/doxygen "/home/blue/sot-devel/dg/doc/package.dox"
 
 documentation: doc/CMakeFiles/documentation
 documentation: doc/html/index.html
@@ -62,10 +62,10 @@ doc/CMakeFiles/documentation.dir/build: documentation
 .PHONY : doc/CMakeFiles/documentation.dir/build
 
 doc/CMakeFiles/documentation.dir/clean:
-	cd /home/blue/sot-devel/dynamicGraph/doc && $(CMAKE_COMMAND) -P CMakeFiles/documentation.dir/cmake_clean.cmake
+	cd /home/blue/sot-devel/dg/doc && $(CMAKE_COMMAND) -P CMakeFiles/documentation.dir/cmake_clean.cmake
 .PHONY : doc/CMakeFiles/documentation.dir/clean
 
 doc/CMakeFiles/documentation.dir/depend:
-	cd /home/blue/sot-devel/dynamicGraph && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/blue/sot-devel/dynamicGraph /home/blue/sot-devel/dynamicGraph/doc /home/blue/sot-devel/dynamicGraph /home/blue/sot-devel/dynamicGraph/doc /home/blue/sot-devel/dynamicGraph/doc/CMakeFiles/documentation.dir/DependInfo.cmake --color=$(COLOR)
+	cd /home/blue/sot-devel/dg && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/blue/sot-devel/dg /home/blue/sot-devel/dg/doc /home/blue/sot-devel/dg /home/blue/sot-devel/dg/doc /home/blue/sot-devel/dg/doc/CMakeFiles/documentation.dir/DependInfo.cmake --color=$(COLOR)
 .PHONY : doc/CMakeFiles/documentation.dir/depend
 
diff --git a/doc/Makefile b/doc/Makefile
index 0c9423e1ff4b3d4a1569ccdd98a5098711391c08..e8efa66605c52bc6fd503d8d1a74a48c58fd2c00 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -42,10 +42,10 @@ RM = /usr/bin/cmake -E remove -f
 CMAKE_EDIT_COMMAND = /usr/bin/ccmake
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/blue/sot-devel/dynamicGraph
+CMAKE_SOURCE_DIR = /home/blue/sot-devel/dg
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/blue/sot-devel/dynamicGraph
+CMAKE_BINARY_DIR = /home/blue/sot-devel/dg
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -111,16 +111,26 @@ rebuild_cache:
 rebuild_cache/fast: rebuild_cache
 .PHONY : rebuild_cache/fast
 
+# Special rule for the target test
+test:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
+	/usr/bin/ctest --force-new-ctest-process $(ARGS)
+.PHONY : test
+
+# Special rule for the target test
+test/fast: test
+.PHONY : test/fast
+
 # The main all target
 all: cmake_check_build_system
-	cd /home/blue/sot-devel/dynamicGraph && $(CMAKE_COMMAND) -E cmake_progress_start /home/blue/sot-devel/dynamicGraph/CMakeFiles /home/blue/sot-devel/dynamicGraph/doc/CMakeFiles/progress.marks
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f CMakeFiles/Makefile2 doc/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/blue/sot-devel/dynamicGraph/CMakeFiles 0
+	cd /home/blue/sot-devel/dg && $(CMAKE_COMMAND) -E cmake_progress_start /home/blue/sot-devel/dg/CMakeFiles /home/blue/sot-devel/dg/doc/CMakeFiles/progress.marks
+	cd /home/blue/sot-devel/dg && $(MAKE) -f CMakeFiles/Makefile2 doc/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/blue/sot-devel/dg/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f CMakeFiles/Makefile2 doc/clean
+	cd /home/blue/sot-devel/dg && $(MAKE) -f CMakeFiles/Makefile2 doc/clean
 .PHONY : clean
 
 # The main clean target
@@ -129,22 +139,22 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f CMakeFiles/Makefile2 doc/preinstall
+	cd /home/blue/sot-devel/dg && $(MAKE) -f CMakeFiles/Makefile2 doc/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f CMakeFiles/Makefile2 doc/preinstall
+	cd /home/blue/sot-devel/dg && $(MAKE) -f CMakeFiles/Makefile2 doc/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /home/blue/sot-devel/dynamicGraph && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /home/blue/sot-devel/dg && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Convenience name for target.
 doc/CMakeFiles/documentation.dir/rule:
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f CMakeFiles/Makefile2 doc/CMakeFiles/documentation.dir/rule
+	cd /home/blue/sot-devel/dg && $(MAKE) -f CMakeFiles/Makefile2 doc/CMakeFiles/documentation.dir/rule
 .PHONY : doc/CMakeFiles/documentation.dir/rule
 
 # Convenience name for target.
@@ -153,7 +163,7 @@ documentation: doc/CMakeFiles/documentation.dir/rule
 
 # fast build rule for target.
 documentation/fast:
-	cd /home/blue/sot-devel/dynamicGraph && $(MAKE) -f doc/CMakeFiles/documentation.dir/build.make doc/CMakeFiles/documentation.dir/build
+	cd /home/blue/sot-devel/dg && $(MAKE) -f doc/CMakeFiles/documentation.dir/build.make doc/CMakeFiles/documentation.dir/build
 .PHONY : documentation/fast
 
 # Help Target
@@ -169,6 +179,7 @@ help:
 	@echo "... install/strip"
 	@echo "... list_install_components"
 	@echo "... rebuild_cache"
+	@echo "... test"
 .PHONY : help
 
 
@@ -180,6 +191,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /home/blue/sot-devel/dynamicGraph && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /home/blue/sot-devel/dg && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system
 
diff --git a/doc/cmake_install.cmake b/doc/cmake_install.cmake
index 1f320649546fa8e4c7c7916f78f8d13bdc8eb2fc..81e11920ec5eaf1eac2a17f52aec4c121715ed9c 100644
--- a/doc/cmake_install.cmake
+++ b/doc/cmake_install.cmake
@@ -1,4 +1,4 @@
-# Install script for directory: /home/blue/sot-devel/dynamicGraph/doc
+# Install script for directory: /home/blue/sot-devel/dg/doc
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -12,7 +12,7 @@ IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
     STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
            CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
   ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "RELEASE")
+    SET(CMAKE_INSTALL_CONFIG_NAME "")
   ENDIF(BUILD_TYPE)
   MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
 ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
@@ -33,14 +33,14 @@ IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
 ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph" TYPE DIRECTORY FILES "/home/blue/sot-devel/dynamicGraph/doc/html")
+  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph" TYPE DIRECTORY FILES "/home/blue/sot-devel/dg/doc/html")
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph/html" TYPE FILE FILES "/home/blue/sot-devel/dynamicGraph/doc/dynamicGraph.doxytag")
+  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph/html" TYPE FILE FILES "/home/blue/sot-devel/dg/doc/dynamic-graph.doxytag")
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph/html" TYPE DIRECTORY FILES "/home/blue/sot-devel/dynamicGraph/doc/pictures")
+  FILE(INSTALL DESTINATION "/home/blue/sot-lib/share/doc/dynamic-graph/html" TYPE DIRECTORY FILES "/home/blue/sot-devel/dg/doc/pictures")
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
diff --git a/doc/package.dox b/doc/package.dox
index 8a2be686f8c5b36d84c6adf8b486d035edbcf43c..c991c9b79036dcf0efdffa1f24cdc1fec04ba947 100644
--- a/doc/package.dox
+++ b/doc/package.dox
@@ -162,7 +162,7 @@ TAGFILES               = \
 	/html/dynamicsJRLJapan.doxytag=/html \
 	/html/hrp2Dynamics.doxytag=/html \
 	/html/walkGenJrl.doxytag=/html
-GENERATE_TAGFILE       = dynamicGraph.doxytag
+GENERATE_TAGFILE       = dynamic-graph.doxytag
 ALLEXTERNALS           = NO
 EXTERNAL_GROUPS        = YES
 PERL_PATH              = /usr/bin/perl
@@ -180,7 +180,7 @@ SEARCHENGINE           = YES
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "dynamicGraph library"
+PROJECT_NAME           = "dynamic-graph library"
 PROJECT_NUMBER         = 1.0.0
 
 #---------------------------------------------------------------------------
@@ -210,13 +210,13 @@ SHOW_DIRECTORIES       = NO
 #---------------------------------------------------------------------------
 FILE_PATTERNS          = *.h *.idl
 EXCLUDE_PATTERNS       = 
-INPUT                  = /home/blue/sot-devel/dynamicGraph/src \
-                         /home/blue/sot-devel/dynamicGraph/doc/additionalDoc
+INPUT                  = /home/blue/sot-devel/dg/include \
+                         /home/blue/sot-devel/dg/doc/additionalDoc
 
 #---------------------------------------------------------------------------
 # configuration options related to inserting images
 #---------------------------------------------------------------------------
-IMAGE_PATH = /home/blue/sot-devel/dynamicGraph/doc/figures
+IMAGE_PATH = /home/blue/sot-devel/dg/doc/figures
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
@@ -233,9 +233,9 @@ VERBATIM_HEADERS       = NO
 # configuration options related to the HTML output
 #---------------------------------------------------------------------------
 HTML_OUTPUT            = html
-HTML_STYLESHEET        = /home/blue/sot-devel/dynamicGraph/doc/package.css
-HTML_HEADER            = /home/blue/sot-devel/dynamicGraph/doc/header.html
-HTML_FOOTER            = /home/blue/sot-devel/dynamicGraph/doc/footer.html
+HTML_STYLESHEET        = /home/blue/sot-devel/dg/doc/package.css
+HTML_HEADER            = /home/blue/sot-devel/dg/doc/header.html
+HTML_FOOTER            = /home/blue/sot-devel/dg/doc/footer.html
 
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
diff --git a/include/dynamic-graph/interpreter.h b/include/dynamic-graph/interpreter.h
index 756963427b47efe62c27347ccfcbfbb201b090b2..b3057d03255b96cd7823d1bb74e7fc43c767d18f 100644
--- a/include/dynamic-graph/interpreter.h
+++ b/include/dynamic-graph/interpreter.h
@@ -104,7 +104,7 @@ class DYNAMICGRAPH_EXPORT Interpreter
   bool deregisterFunction( const std::string& funname );
 
 
-  /*! \brief Return the reference to the plugin loader. */
+  /*! \brief Set the reference of the plugin loader. */
   void referencePluginLoader( PluginLoader* dl__ )
   { dlPtr = dl__; }
 
diff --git a/include/dynamic-graph/plugin-loader.h b/include/dynamic-graph/plugin-loader.h
index f86f63537d26abf628cc380e4bbda9ffcde0a327..e4c1542dc96575d54814e44ff0ea00defc89ab45 100644
--- a/include/dynamic-graph/plugin-loader.h
+++ b/include/dynamic-graph/plugin-loader.h
@@ -97,7 +97,12 @@ class DYNAMICGRAPH_EXPORT PluginLoader
   void addPlugin( const std::string& name, const std::string& dir="" );
   /*! \brief Load the plugins previously added */
   void loadPlugins( void );
+  /*! \brief Remove from the user memory the dynamic library related to the plugin. */
   void unloadPlugin( const std::string& plugname );
+  /*! \brief Remove all the dynamic libraries related to the plugins.
+      For non-re-entrant plugins this method HAS TO be called. */
+    void unloadAllPlugins();
+
 
   const std::map< std::string,std::string > getLoadedPluginNames( void ) 
   { return loadedPluginNames; }
diff --git a/src/dgraph/interpreter.cpp b/src/dgraph/interpreter.cpp
index 92bde1d568aa1bb3863b7f57ce145850b7a87869..9236029476b2285daa86d558990475c740093798 100644
--- a/src/dgraph/interpreter.cpp
+++ b/src/dgraph/interpreter.cpp
@@ -194,7 +194,7 @@ cmdLoadPlugin( const std::string& cmdLine, std::istringstream& cmdArg, std::ostr
 	dgDEBUG(25)<<"sotShell.dlPtr ="<< this->dlPtr <<endl;
 	dlPtr->loadPlugins();
 	dgDEBUG(25)<<"sotShell.dlPtr ="<< this->dlPtr <<endl;
-      }catch( ExceptionAbstract& e ) { dgDEBUG(5) << e << endl; throw e; }
+      }catch( ExceptionAbstract& e ) { dgDEBUG(5) << "ExceptionAbstract " << e << endl; throw e; }
     }
   else { os << "!!  Dynamic loading functionalities not accessible through the shell." <<endl; }
 }
diff --git a/src/dgraph/plugin-loader.cpp b/src/dgraph/plugin-loader.cpp
index 719d1923c0fdfda303782126e27fe25c8aa13676..1393d4f92d49f544a554028d14a0070456a2c6c5 100644
--- a/src/dgraph/plugin-loader.cpp
+++ b/src/dgraph/plugin-loader.cpp
@@ -261,3 +261,51 @@ searchPlugin( const std::string& plugname )
 
   return *plugFullName;
 }
+
+
+void PluginLoader::
+unloadAllPlugins()
+{
+  dgDEBUGIN( 15 );
+
+  PluginRefMap::KeyMap::iterator plugkey = pluginRefs->keyMap.begin();
+
+  while( plugkey!=pluginRefs->keyMap.end() )
+    {
+#ifndef WIN32
+      const int errCode = dlclose(plugkey->second);
+#else
+      const int errCode = FreeLibrary(plugkey->second);
+#endif
+      if( errCode )
+	{
+#ifndef WIN32
+	  dgDEBUG(1) << "Error while unloading <" << plugkey->first <<"> : "
+		      << dlerror() <<endl;
+#else
+	  // Retrieve the system error message for the last-error code
+	  LPTSTR pszMessage;
+	  DWORD dwLastError = GetLastError();
+	  FormatMessage(
+			FORMAT_MESSAGE_ALLOCATE_BUFFER |
+			FORMAT_MESSAGE_FROM_SYSTEM |
+			FORMAT_MESSAGE_IGNORE_INSERTS,
+			NULL,
+			dwLastError,
+			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+			(LPTSTR)&pszMessage,
+			0, NULL );
+
+	  dgDEBUG(1) << "Error while unloading <" << plugkey->first <<"> : "
+		      << pszMessage <<endl;
+
+	  LocalFree(pszMessage);
+#endif
+	}
+      plugkey++;
+    }
+
+  //pluginRefs.erase( plugkey );
+
+  dgDEBUGOUT( 15 );
+}