diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index c50290d..4551e84 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -274,6 +274,31 @@
 	return st.st_size;
 }
 
+std::string TWFunc::Remove_Trailing_Slashes(const std::string& path, bool leaveLast)
+{
+	std::string res;
+	size_t last_idx = 0, idx = 0;
+
+	while(last_idx != std::string::npos)
+	{
+		if(last_idx != 0)
+			res += '/';
+
+		idx = path.find_first_of('/', last_idx);
+		if(idx == std::string::npos) {
+			res += path.substr(last_idx, idx);
+			break;
+		}
+
+		res += path.substr(last_idx, idx-last_idx);
+		last_idx = path.find_first_not_of('/', idx);
+	}
+
+	if(leaveLast)
+		res += '/';
+	return res;
+}
+
 #ifndef BUILD_TWRPTAR_MAIN
 
 // Returns "/path" from a full /path/to/file.name
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index 661ca02..64a45f5 100644
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -49,6 +49,7 @@
 	static int Get_File_Type(string fn); // Determines file type, 0 for unknown, 1 for gzip, 2 for OAES encrypted
 	static int Try_Decrypting_File(string fn, string password); // -1 for some error, 0 for failed to decrypt, 1 for decrypted, 3 for decrypted and found gzip format
 	static unsigned long Get_File_Size(string Path);                            // Returns the size of a file
+	static std::string Remove_Trailing_Slashes(const std::string& path, bool leaveLast = false); // Normalizes the path, e.g /data//media/ -> /data/media
 
 #ifndef BUILD_TWRPTAR_MAIN
 	static void install_htc_dumlock(void);                                      // Installs HTC Dumlock
diff --git a/twrpDU.cpp b/twrpDU.cpp
index c4446d4..d2345d7 100644
--- a/twrpDU.cpp
+++ b/twrpDU.cpp
@@ -27,19 +27,21 @@
 #include <fstream>
 #include <string>
 #include <vector>
+#include <algorithm>
 #include "twrpDU.hpp"
+#include "twrp-functions.hpp"
 
 using namespace std;
 
 twrpDU::twrpDU() {
 		add_relative_dir(".");
 		add_relative_dir("..");
-		add_relative_dir("lost_found");
+		add_relative_dir("lost+found");
 		add_absolute_dir("/data/data/com.google.android.music/files");
 		parent = "";
 }
 
-void twrpDU::add_relative_dir(string dir) {
+void twrpDU::add_relative_dir(const string& dir) {
 	relativedir.push_back(dir);
 }
 
@@ -53,8 +55,8 @@
 	}
 }
 
-void twrpDU::add_absolute_dir(string dir) {
-	absolutedir.push_back(dir);
+void twrpDU::add_absolute_dir(const string& dir) {
+	absolutedir.push_back(TWFunc::Remove_Trailing_Slashes(dir));
 }
 
 vector<string> twrpDU::get_absolute_dirs(void) {
@@ -79,12 +81,7 @@
 
 	while ((de = readdir(d)) != NULL)
 	{
-		bool skip_dir = false;
-		if (de->d_type == DT_DIR) {
-			string dir = de->d_name;
-			skip_dir = check_skip_dirs(dir);
-		}
-		if (de->d_type == DT_DIR && !skip_dir) {
+		if (de->d_type == DT_DIR && !check_skip_dirs(Path, de->d_name)) {
 			dutemp = Get_Folder_Size((Path + "/" + de->d_name));
 			dusize += dutemp;
 			dutemp = 0;
@@ -98,19 +95,25 @@
 	return dusize;
 }
 
-bool twrpDU::check_skip_dirs(string& dir) {
-	bool result = false;
-	for (int i = 0; i < relativedir.size(); ++i) {
-		if (dir == relativedir.at(i)) {
-			result = true;
-			break;
-		}
+bool twrpDU::check_relative_skip_dirs(const string& dir) {
+	return std::find(relativedir.begin(), relativedir.end(), dir) != relativedir.end();
+}
+
+bool twrpDU::check_absolute_skip_dirs(const string& path) {
+	string normalized = TWFunc::Remove_Trailing_Slashes(path);
+	return std::find(absolutedir.begin(), absolutedir.end(), normalized) != absolutedir.end();
+}
+
+bool twrpDU::check_skip_dirs(const string& parent, const string& dir) {
+	return check_relative_skip_dirs(dir) || check_absolute_skip_dirs(parent + "/" + dir);
+}
+
+bool twrpDU::check_skip_dirs(const string& path) {
+	string normalized = TWFunc::Remove_Trailing_Slashes(path);
+	size_t slashIdx = normalized.find_last_of('/');
+	if(slashIdx != std::string::npos && slashIdx+1 < normalized.size()) {
+		if(check_relative_skip_dirs(normalized.substr(slashIdx+1)))
+			return true;
 	}
-	for (int i = 0; i < absolutedir.size(); ++i) {
-		if (dir == absolutedir.at(i)) {
-			result = true;
-			break;
-		}
-	}
-	return result;
+	return check_absolute_skip_dirs(normalized);
 }
diff --git a/twrpDU.hpp b/twrpDU.hpp
index dac15f1..91f5039 100644
--- a/twrpDU.hpp
+++ b/twrpDU.hpp
@@ -38,9 +38,12 @@
 public:
 	twrpDU();
 	uint64_t Get_Folder_Size(const string& Path); // Gets the folder's size using stat
-	void add_absolute_dir(string Path);
-	void add_relative_dir(string Path);
-	bool check_skip_dirs(string& dir);
+	void add_absolute_dir(const string& Path);
+	void add_relative_dir(const string& Path);
+	bool check_relative_skip_dirs(const string& dir);
+	bool check_absolute_skip_dirs(const string& path);
+	bool check_skip_dirs(const string& parent, const string& dir);
+	bool check_skip_dirs(const string& path);
 	vector<string> get_absolute_dirs(void);
 	void clear_relative_dir(string dir);
 private:
diff --git a/twrpTar.cpp b/twrpTar.cpp
index a31fe12..c024821 100644
--- a/twrpTar.cpp
+++ b/twrpTar.cpp
@@ -124,10 +124,7 @@
 					continue; // Skip /data/media
 				if (de->d_type == DT_BLK || de->d_type == DT_CHR)
 					continue;
-				bool skip_dir = false;
-				string dir(de->d_name);
-				skip_dir = du.check_skip_dirs(dir);
-				if (de->d_type == DT_DIR && !skip_dir) {
+				if (de->d_type == DT_DIR && !du.check_skip_dirs(tardir, de->d_name)) {
 					item_len = strlen(de->d_name);
 					if (userdata_encryption && ((item_len >= 3 && strncmp(de->d_name, "app", 3) == 0) || (item_len >= 6 && strncmp(de->d_name, "dalvik", 6) == 0))) {
 						if (Generate_TarList(FileName, &RegularList, &target_size, &regular_thread_id) < 0) {
@@ -171,10 +168,7 @@
 					continue; // Skip /data/media
 				if (de->d_type == DT_BLK || de->d_type == DT_CHR)
 					continue;
-				bool skip_dir = false;
-				string dir(de->d_name);
-				skip_dir = du.check_skip_dirs(dir);
-				if (de->d_type == DT_DIR && !skip_dir) {
+				if (de->d_type == DT_DIR && !du.check_skip_dirs(tardir, de->d_name)) {
 					item_len = strlen(de->d_name);
 					if (userdata_encryption && ((item_len >= 3 && strncmp(de->d_name, "app", 3) == 0) || (item_len >= 6 && strncmp(de->d_name, "dalvik", 6) == 0))) {
 						// Do nothing, we added these to RegularList earlier
@@ -485,10 +479,7 @@
 			continue;
 		TarItem.fn = FileName;
 		TarItem.thread_id = *thread_id;
-		bool skip_dir = false;
-		string dir(de->d_name);
-		skip_dir = du.check_skip_dirs(dir);
-		if (de->d_type == DT_DIR && !skip_dir) {
+		if (de->d_type == DT_DIR && !du.check_skip_dirs(Path, de->d_name)) {
 			TarList->push_back(TarItem);
 			if (Generate_TarList(FileName, TarList, Target_Size, thread_id) < 0)
 				return -1;
