diff --git a/adb_install.cpp b/adb_install.cpp
index c731d1c..77b9a8c 100644
--- a/adb_install.cpp
+++ b/adb_install.cpp
@@ -36,7 +36,7 @@
 
 static RecoveryUI* ui = NULL;
 
-static void
+void
 set_usb_driver(bool enabled) {
     int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY);
     if (fd < 0) {
@@ -68,7 +68,7 @@
 }
 
 
-static void
+void
 maybe_restart_adbd() {
     char value[PROPERTY_VALUE_MAX+1];
     int len = property_get("ro.debuggable", value, NULL);
@@ -128,12 +128,14 @@
                 break;
             }
         }
-        printf("FIX ME: need to make adb sideload actually install the file!\n");
-        //result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false);
+        property_set("tw_sideload_file", FUSE_SIDELOAD_HOST_PATHNAME);
+        // Install is handled elsewhere in TWRP
+        result = 5; //install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false);
         break;
     }
 
-    if (!waited) {
+    // We do this elsewhere in TWRP
+    /*if (!waited) {
         // Calling stat() on this magic filename signals the minadbd
         // subprocess to shut down.
         stat(FUSE_SIDELOAD_HOST_EXIT_PATHNAME, &st);
@@ -143,25 +145,26 @@
         // you just have to 'adb sideload' a file that's not a valid
         // package, like "/dev/null".
         waitpid(child, &status, 0);
-    }
+    }*/
 
-    if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
-        if (WEXITSTATUS(status) == 3) {
-            printf("\nYou need adb 1.0.32 or newer to sideload\nto this device.\n\n");
-        } else if (!WIFSIGNALED(status)) {
-            printf("status %d\n", WEXITSTATUS(status));
+    if (result != 5) {
+        stat(FUSE_SIDELOAD_HOST_EXIT_PATHNAME, &st);
+        waitpid(child, &status, 0);
+        result = -1;
+        if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+            if (WEXITSTATUS(status) == 3) {
+                printf("\nYou need adb 1.0.32 or newer to sideload\nto this device.\n\n");
+                result = -2;
+            } else if (!WIFSIGNALED(status)) {
+                printf("status %d\n", WEXITSTATUS(status));
+            }
         }
-    }
-    set_usb_driver(false);
-    maybe_restart_adbd();
+	    set_usb_driver(false);
+	    maybe_restart_adbd();
+	    return result;
+	} else {
+        return 0;
+	}
 
-    if (stat(install_file, &st) != 0) {
-        if (errno == ENOENT) {
-            printf("No package received.\n");
-        } else {
-            printf("Error reading package:\n  %s\n", strerror(errno));
-        }
-        return -1;
-    }
-	return 0;
+	return -1; // This should not happen
 }
diff --git a/adb_install.h b/adb_install.h
index a7cb336..604c61d 100644
--- a/adb_install.h
+++ b/adb_install.h
@@ -19,6 +19,8 @@
 
 //class RecoveryUI;
 
+void set_usb_driver(bool enabled);
+void maybe_restart_adbd();
 int apply_from_adb(const char* install_file);
 
 #endif
diff --git a/gui/action.cpp b/gui/action.cpp
index 612e990..6b8565a 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -51,6 +51,7 @@
 #include "../twinstall.h"
 #include "cutils/properties.h"
 #include "../minadbd/adb.h"
+#include "../adb_install.h"
 
 int TWinstall_zip(const char* path, int* wipe_cache);
 void run_script(const char *str1, const char *str2, const char *str3, const char *str4, const char *str5, const char *str6, const char *str7, int request_confirm);
@@ -1257,30 +1258,42 @@
 			} else {
 				int wipe_cache = 0;
 				int wipe_dalvik = 0;
-				string Sideload_File;
 
-				if (!PartitionManager.Mount_Current_Storage(false)) {
-					gui_print("Using RAM for sideload storage.\n");
-					Sideload_File = "/tmp/sideload.zip";
-				} else {
-					Sideload_File = DataManager::GetCurrentStoragePath() + "/sideload.zip";
-				}
-				if (TWFunc::Path_Exists(Sideload_File)) {
-					unlink(Sideload_File.c_str());
-				}
 				gui_print("Starting ADB sideload feature...\n");
 				DataManager::GetValue("tw_wipe_dalvik", wipe_dalvik);
-				ret = apply_from_adb(Sideload_File.c_str());
+				ret = apply_from_adb("/");
 				DataManager::SetValue("tw_has_cancel", 0); // Remove cancel button from gui now that the zip install is going to start
+				char file_prop[PROPERTY_VALUE_MAX];
+				property_get("tw_sideload_file", file_prop, "error");
 				if (ret != 0) {
 					ret = 1; // failure
-				} else if (TWinstall_zip(Sideload_File.c_str(), &wipe_cache) == 0) {
-					if (wipe_cache || DataManager::GetIntValue("tw_wipe_cache"))
-						PartitionManager.Wipe_By_Path("/cache");
-					if (wipe_dalvik)
-						PartitionManager.Wipe_Dalvik_Cache();
+					if (ret == -2)
+						gui_print("You need adb 1.0.32 or newer to sideload to this device.\n");
 				} else {
-					ret = 1; // failure
+					if (TWinstall_zip(file_prop, &wipe_cache) == 0) {
+						if (wipe_cache || DataManager::GetIntValue("tw_wipe_cache"))
+							PartitionManager.Wipe_By_Path("/cache");
+						if (wipe_dalvik)
+							PartitionManager.Wipe_Dalvik_Cache();
+					} else {
+						ret = 1; // failure
+					}
+					set_usb_driver(false);
+					maybe_restart_adbd();
+				}
+				if (strcmp(file_prop, "error") != 0) {
+					struct stat st;
+					stat("/sideload/exit", &st);
+					int child_pid, status;
+					char child_prop[PROPERTY_VALUE_MAX];
+					property_get("tw_child_pid", child_prop, "error");
+					if (strcmp(child_prop, "error") == 0) {
+						LOGERR("Unable to get child ID from prop\n");
+					} else {
+						child_pid = atoi(child_prop);
+						LOGINFO("Waiting for child sideload process to exit.\n");
+						waitpid(child_pid, &status, 0);
+					}
 				}
 				if (DataManager::GetIntValue(TW_HAS_INJECTTWRP) == 1 && DataManager::GetIntValue(TW_INJECT_AFTER_ZIP) == 1) {
 					operation_start("ReinjectTWRP");
@@ -1304,18 +1317,19 @@
 		}
 		if (function == "adbsideloadcancel")
 		{
-			int child_pid;
+			int child_pid, status;
 			char child_prop[PROPERTY_VALUE_MAX];
-			string Sideload_File;
-			Sideload_File = DataManager::GetCurrentStoragePath() + "/sideload.zip";
-			unlink(Sideload_File.c_str());
+			struct stat st;
+			DataManager::SetValue("tw_has_cancel", 0); // Remove cancel button from gui
+			gui_print("Cancelling ADB sideload...\n");
+			stat("/sideload/exit", &st);
+			sleep(1);
 			property_get("tw_child_pid", child_prop, "error");
 			if (strcmp(child_prop, "error") == 0) {
 				LOGERR("Unable to get child ID from prop\n");
 				return 0;
 			}
 			child_pid = atoi(child_prop);
-			gui_print("Cancelling ADB sideload...\n");
 			kill(child_pid, SIGTERM);
 			DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support
 			return 0;
diff --git a/minadbd/usb_linux_client.c b/minadbd/usb_linux_client.c
index 29bab15..ec32bcf 100644
--- a/minadbd/usb_linux_client.c
+++ b/minadbd/usb_linux_client.c
@@ -256,7 +256,7 @@
         close_on_exec(fd);
     }
 
-    D("[ usb_init - starting thread ]\n");
+    printf("[ usb_init - starting thread ]\n");
     if(adb_thread_create(&tid, usb_adb_open_thread, h)){
         fatal_errno("cannot create usb thread");
         fprintf(stderr, "cannot create the usb thread()\n");
diff --git a/twinstall.cpp b/twinstall.cpp
index 595c4d2..4e478d4 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -257,14 +257,22 @@
 	string strpath = path;
 	ZipArchive Zip;
 
-	gui_print("Installing '%s'...\nChecking for MD5 file...\n", path);
-	md5sum.setfn(strpath);
-	md5_return = md5sum.verify_md5digest();
-	if (md5_return == -2) { // md5 did not match
-		LOGERR("Aborting zip install\n");
+	if (strcmp(path, "error") == 0) {
+		LOGERR("Failed to get adb sideload file: '%s'\n", path);
 		return INSTALL_CORRUPT;
 	}
 
+	gui_print("Installing '%s'...\n", path);
+	if (strlen(path) < 9 || strncmp(path, "/sideload", 9) != 0) {
+		gui_print("Checking for MD5 file...\n");
+		md5sum.setfn(strpath);
+		md5_return = md5sum.verify_md5digest();
+		if (md5_return == -2) { // md5 did not match
+			LOGERR("Aborting zip install\n");
+			return INSTALL_CORRUPT;
+		}
+	}
+
 #ifndef TW_OEM_BUILD
 	DataManager::GetValue(TW_SIGNED_ZIP_VERIFY_VAR, zip_verify);
 #endif
