diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php
index a1bb843d7260d875d6d9135ca3bbc19aca69abce..bbe4c130bddd79a3c484b0a204bbef119eb9a6d5 100644
--- a/apps/files_sharing/lib/share/folder.php
+++ b/apps/files_sharing/lib/share/folder.php
@@ -26,11 +26,11 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
 		$parents = array($itemSource);
 		while (!empty($parents)) {
 			$parents = "'".implode("','", $parents)."'";
-			$query = OC_DB::prepare('SELECT `id`, `name`, `mimetype` FROM `*PREFIX*fscache` WHERE `parent` IN ('.$parents.')');
+			$query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')');
 			$result = $query->execute();
 			$parents = array();
 			while ($file = $result->fetchRow()) {
-				$children[] = array('source' => $file['id'], 'file_path' => $file['name']);
+				$children[] = array('source' => $file['fileid'], 'file_path' => $file['name']);
 				// If a child folder is found look inside it
 				if ($file['mimetype'] == 'httpd/unix-directory') {
 					$parents[] = $file['id'];
diff --git a/lib/public/share.php b/lib/public/share.php
index 8981de1b508b6b2e6f6c8a7e373ec0104b215a03..2775a07f13301604f75aa3f9e1b24f587ab90deb 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -739,7 +739,8 @@ class Share {
 				if (isset($row['parent'])) {
 					$row['path'] = '/Shared/'.basename($row['path']);
 				} else {
-					$row['path'] = substr($row['path'], $root);
+					// Strip 'files' from path
+					$row['path'] = substr($row['path'], 5);
 				}
 			}
 			if (isset($row['expiration'])) {