diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 3b678178c3653094c104067b8d62802433bd1f72..b0770cbfdba2d60879b529d653e3bdcd0fd53bc1 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -29,11 +29,11 @@ OC_FILESYSTEM::registerStorageType('shared','OC_FILESTORAGE_SHARED',array('datad
  */
 class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 	
+	private $datadir;
 	private $sourcePaths = array();
 	
-	// TODO uh... I don't know what to do here
-	public function __construct($parameters) {
-		
+	public function __construct($arguments) {
+		$this->datadir = $arguments['datadir'];
 	}
 	
 	public function getInternalPath($path) {
@@ -43,7 +43,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 	}
 	
 	public function getSource($target) {
-		$target = OC_FILESYSTEM::getStorageMountPoint($this).$target;
+		$target = $this->datadir.$target;
 		if (array_key_exists($target, $this->sourcePaths)) {
 			return $this->sourcePaths[$target];
 		} else {
@@ -59,8 +59,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 		} else {
 			$source = $this->getSource($path);
 			if ($source) {
-				$target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
-				if (OC_SHARE::isWriteable($target)) {
+				if (OC_SHARE::isWriteable($this->datadir.$path)) {
 					$storage = OC_FILESYSTEM::getStorage($source);
 					return $storage->mkdir($this->getInternalPath($source));
 				}
@@ -70,16 +69,17 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 	
 	public function rmdir($path) {
 		// The folder will be removed from the database, but won't be deleted from the owner's filesystem
-		$target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
-		OC_SHARE::unshareFromSelf($target);
+		OC_SHARE::unshareFromSelf($this->datadir.$path);
 	}
 	
+	// TODO Make sure new target is still in the current directory
 	public function opendir($path) {
 		if ($path == "" || $path == "/") {
 			global $FAKEDIRS;
 			$sharedItems = OC_SHARE::getItemsSharedWith();
 			foreach ($sharedItems as $item) {
-				$files[] = $item['target'];
+				// TODO Implement a better fix
+				$files[] = substr($item['target'], strpos($item['target'], "Share") + 5);
 			}
 			$FAKEDIRS['shared'] = $files;
 			return opendir('fakedir://shared');
@@ -242,8 +242,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 		if ($path == "" || $path == "/") {
 			return true;
 		} else {
-			$target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
-			return OC_SHARE::isWriteable($target);
+			return OC_SHARE::isWriteable($this->datadir.$path);
 		}
 	}
 	
@@ -346,14 +345,11 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
 	
 	public function unlink($path) {
 		// The file will be removed from the database, but won't be deleted from the owner's filesystem
-		$target = OC_FILESYSTEM::getStorageMountPoint($this).$path;
-		OC_SHARE::unshareFromSelf($target);
+		OC_SHARE::unshareFromSelf($this->datadir.$path);
 	}
 	
 	public function rename($path1, $path2) {
-		$oldTarget = OC_FILESYSTEM::getStorageMountPoint($this).$path1;
-		$newTarget = OC_FILESYSTEM::getStorageMountPoint($this).$path2;
-		OC_SHARE::setTarget($oldTarget, $newTarget);
+		OC_SHARE::setTarget($this->datadir.$path1, $this->datadir.$path2);
 	}
 	
 	public function copy($path1, $path2) {
diff --git a/lib/base.php b/lib/base.php
index 4250274c7c363a861b835e842c499a6ebedc0594..d369b392a4fed3e3e75c1439f4620d4f7f76ab6f 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -166,7 +166,7 @@ class OC_UTIL {
 			OC_FILESYSTEM::mount($rootStorage,'/');
 
 			// TODO add this storage provider in a proper way
-			$sharedStorage = OC_FILESYSTEM::createStorage('shared',array('datadir'=>$CONFIG_DATADIRECTORY));
+			$sharedStorage = OC_FILESYSTEM::createStorage('shared',array('datadir'=>'/MTGap/files/Share/'));
 			OC_FILESYSTEM::mount($sharedStorage,'MTGap/files/Share/');
 			
 			$CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
diff --git a/lib/filesystem.php b/lib/filesystem.php
index c7e2070fa0a8b422cd683cc9a56374b633c5a799..1f96e139ab33b5fa74ea4015710183d2df0b940d 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -215,15 +215,6 @@ class OC_FILESYSTEM{
 		return $foundMountPoint;
 	}
 	
-	/**
-	* get the mountpoint of the storage object
-	* @param OC_FILESTORAGE storage
-	* @return string
-	*/
-	static public function getStorageMountPoint($storage){
-		return array_search($storage, self::$storages);
-	}
-	
 	/**
 	* return the path to a local version of the file
 	* we need this because we can't know if a file is stored local or not from outside the filestorage and for some purposes a local file is needed