Index: code/trunk/src/libraries/core/ApplicationPaths.cc
===================================================================
--- code/trunk/src/libraries/core/ApplicationPaths.cc	(revision 11691)
+++ code/trunk/src/libraries/core/ApplicationPaths.cc	(revision 11692)
@@ -32,4 +32,5 @@
 #include <cstdlib>
 #include <cstdio>
+#include <fstream>
 #include <vector>
 #include <boost/filesystem.hpp>
@@ -169,17 +170,17 @@
     }
 
-    std::vector<std::string> ApplicationPaths::getModulePaths()
+    std::map<std::string, std::string> ApplicationPaths::getModulePaths()
     {
         return this->getModuleOrPluginPaths(modulePath_, specialConfig::moduleExtension);
     }
 
-    std::vector<std::string> ApplicationPaths::getPluginPaths()
+    std::map<std::string, std::string> ApplicationPaths::getPluginPaths()
     {
         return this->getModuleOrPluginPaths(pluginPath_, specialConfig::pluginExtension);
     }
 
-    std::vector<std::string> ApplicationPaths::getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension)
-    {
-        std::vector<std::string> paths;
+    std::map<std::string, std::string> ApplicationPaths::getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension)
+    {
+        std::map<std::string, std::string> paths;
 
         // We search for helper files with the following extension
@@ -204,6 +205,18 @@
                 {
                     // We've found a helper file
-                    const std::string& library = filename.substr(0, filename.size() - extensionlength);
-                    paths.push_back(directory.BF_GENERIC_STRING() + '/' + library);
+                    const std::string& moduleName = filename.substr(0, filename.size() - extensionlength);
+
+                    // Read it's content to get the library's name
+                    std::ifstream infile(file->path().string().c_str());
+                    std::string libraryName;
+                    if (infile >> libraryName)
+                    {
+                        std::string libraryPath = directory.BF_GENERIC_STRING() + '/' + libraryName;
+                        paths[moduleName] = libraryPath;
+                    }
+                    else
+                    {
+                        orxout(internal_warning) << "Could not file " << filename << endl;
+                    }
                 }
             }
Index: code/trunk/src/libraries/core/ApplicationPaths.h
===================================================================
--- code/trunk/src/libraries/core/ApplicationPaths.h	(revision 11691)
+++ code/trunk/src/libraries/core/ApplicationPaths.h	(revision 11692)
@@ -98,8 +98,8 @@
             static bool buildDirectoryRun() { return getInstance().bBuildDirectoryRun_; }
 
-            //! Returns a list with all modules declared by a *.module file in the module folder.
-            std::vector<std::string> getModulePaths();
-            //! Returns a list with all plugins declared by a *.plugin file in the plugin folder.
-            std::vector<std::string> getPluginPaths();
+            //! Returns a map with all modules declared by a *.module file in the module folder; key = module-name, value = library-path (content of the file).
+            std::map<std::string, std::string> getModulePaths();
+            //! Returns a map with all plugins declared by a *.plugin file in the plugin folder; key = plugin-name, value = library-path (content of the file).
+            std::map<std::string, std::string> getPluginPaths();
 
         private:
@@ -108,5 +108,5 @@
             ApplicationPaths& operator=(const ApplicationPaths&) = delete;
 
-            std::vector<std::string> getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension);
+            std::map<std::string, std::string> getModuleOrPluginPaths(boost::filesystem::path& directory, const std::string& extension);
 
             //! Path to the parent directory of the ones above if program was installed with relative paths
Index: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc	(revision 11691)
+++ code/trunk/src/libraries/core/Core.cc	(revision 11692)
@@ -281,8 +281,8 @@
         orxout(internal_info) << "Loading modules:" << endl;
 
-        const std::vector<std::string>& modulePaths = ApplicationPaths::getInstance().getModulePaths();
-        for (const std::string& modulePath : modulePaths)
-        {
-            ModuleInstance* module = new ModuleInstance(modulePath);
+        const std::map<std::string, std::string>& modulePaths = ApplicationPaths::getInstance().getModulePaths();
+        for (const std::pair<std::string, std::string>& modulePath : modulePaths)
+        {
+            ModuleInstance* module = new ModuleInstance(modulePath.second);
             this->loadModule(module);
             this->modules_.push_back(module);
Index: code/trunk/src/libraries/core/module/PluginManager.cc
===================================================================
--- code/trunk/src/libraries/core/module/PluginManager.cc	(revision 11691)
+++ code/trunk/src/libraries/core/module/PluginManager.cc	(revision 11692)
@@ -28,6 +28,4 @@
 
 #include "PluginManager.h"
-
-#include <fstream>
 
 #include "SpecialConfig.h"
@@ -95,19 +93,12 @@
     void PluginManager::findPlugins()
     {
-        const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
-        for (const std::string& libraryName : pluginPaths)
+        const std::map<std::string, std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
+        for (const std::pair<std::string, std::string>& pluginPath : pluginPaths)
         {
-            std::string name;
-            std::string filename = libraryName +  + specialConfig::pluginExtension;
-            std::ifstream infile(filename.c_str());
-            if (infile >> name)
-            {
-                orxout(internal_info) << "Found plugin with name '" << name << "' in module " << libraryName << endl;
-                this->plugins_[name] = new Plugin(name, libraryName);
-            }
-            else
-            {
-                orxout(internal_warning) << "Could not read plugin file " << filename << endl;
-            }
+            const std::string& name = pluginPath.first;
+            const std::string& libraryName = pluginPath.second;
+
+            orxout(internal_info) << "Found plugin with name '" << name << "' in module " << libraryName << endl;
+            this->plugins_[name] = new Plugin(name, libraryName);
         }
     }
