diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 6e375f99a8e4f31348b55ee52328be6550eeb13a..f2096c3956e3b6e5f2ef49e58f065e644c6e0792 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -320,14 +320,9 @@ class Hooks {
 
 			$sharingEnabled = \OCP\Share::isEnabled();
 
-			// get the path including mount point only if not a shared folder
-			list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
-
-			if (!($storage instanceof \OC\Files\Storage\Local)) {
-				$mountPoint = 'files' . $storage->getMountPoint();
-			} else {
-				$mountPoint = '';
-			}
+			$mountManager = \OC\Files\Filesystem::getMountManager();
+			$mount = $mountManager->find('/' . $userId . '/files' . $path);
+			$mountPoint = $mount->getMountPoint();
 
 			// if a folder was shared, get a list of all (sub-)folders
 			if ($params['itemType'] === 'folder') {
@@ -370,14 +365,9 @@ class Hooks {
 				}
 			}
 
-			// get the path including mount point only if not a shared folder
-			list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
-
-			if (!($storage instanceof \OC\Files\Storage\Local)) {
-				$mountPoint = 'files' . $storage->getMountPoint();
-			} else {
-				$mountPoint = '';
-			}
+			$mountManager = \OC\Files\Filesystem::getMountManager();
+			$mount = $mountManager->find('/' . $userId . '/files' . $path);
+			$mountPoint = $mount->getMountPoint();
 
 			// if we unshare a folder we need a list of all (sub-)files
 			if ($params['itemType'] === 'folder') {
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index d20efc3ac7be9894eb3ed55179324103bc812e1c..991960b7fa9ad88ab9f345598f0e3ae3edd5b768 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1384,10 +1384,11 @@ class Util {
 				// getDirectoryContent() returns the paths relative to the mount points, so we need
 				// to re-construct the complete path
 				$path = ($mountPoint !== '') ? $mountPoint . '/' .  $c['path'] : $c['path'];
+				$path = \OC\Files\Filesystem::normalizePath($path);
 				if ($c['type'] === 'dir') {
-					$dirList[] = substr($path, strlen("files"));
+					$dirList[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
 				} else {
-					$result[] = substr($path, strlen("files"));
+					$result[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
 				}
 			}