diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index 0f8d903..b7804fd 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -659,7 +659,7 @@
 
 int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y)
 {
-	static int lastY = 0, last2Y = 0;
+	static int lastY = 0, last2Y = 0, fastScroll = 0;
 	int selection = 0;
 
 	switch (state)
@@ -674,6 +674,9 @@
 			mUpdate = 1;
 		startY = lastY = last2Y = y;
 		scrollingSpeed = 0;
+
+		if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW)
+			fastScroll = 1;
 		break;
 	case TOUCH_DRAG:
 		// Check if we dragged out of the selection window
@@ -687,7 +690,7 @@
 		}
 
 		// Fast scroll
-		if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW)
+		if(fastScroll)
 		{
 			int pct = ((y-mRenderY-mHeaderH)*100)/(mRenderH-mHeaderH);
 			int totalSize = (mShowFolders ? mFolderList.size() : 0) + (mShowFiles ? mFileList.size() : 0);
@@ -761,6 +764,7 @@
 
 	case TOUCH_RELEASE:
 		isHighlighted = false;
+		fastScroll = 0;
 		if (startSelection >= 0)
 		{
 			// We've selected an item!
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index a4976f4..6709664 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -602,7 +602,7 @@
 
 int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y)
 {
-	static int lastY = 0, last2Y = 0;
+	static int lastY = 0, last2Y = 0, fastScroll = 0;
 	int selection = 0;
 
 	switch (state)
@@ -617,6 +617,9 @@
 			mUpdate = 1;
 		startY = lastY = last2Y = y;
 		scrollingSpeed = 0;
+
+		if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW)
+			fastScroll = 1;
 		break;
 
 	case TOUCH_DRAG:
@@ -631,7 +634,7 @@
 		}
 
 		// Fast scroll
-		if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW)
+		if(fastScroll)
 		{
 			int pct = ((y-mRenderY-mHeaderH)*100)/(mRenderH-mHeaderH);
 			int totalSize = mList.size();
@@ -705,6 +708,7 @@
 
 	case TOUCH_RELEASE:
 		isHighlighted = false;
+		fastScroll = 0;
 		if (startSelection >= 0)
 		{
 			// We've selected an item!
diff --git a/minui/Android.mk b/minui/Android.mk
index d889587..704e541 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -31,8 +31,16 @@
   LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
 endif
 
-ifneq ($(TARGET_RECOVERY_LCD_BACKLIGHT_PATH),)
-  LOCAL_CFLAGS += -DRECOVERY_LCD_BACKLIGHT_PATH=$(TARGET_RECOVERY_LCD_BACKLIGHT_PATH)
+ifneq ($(TW_BRIGHTNESS_PATH),)
+  LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=\"$(TW_BRIGHTNESS_PATH)\"
+endif
+ifneq ($(TW_MAX_BRIGHTNESS),)
+  LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
+else
+  LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
+endif
+ifneq ($(TW_NO_SCREEN_BLANK),)
+  LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
 endif
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/minui/graphics.c b/minui/graphics.c
index ff39674..00fbb1e 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -437,15 +437,17 @@
 
 void gr_fb_blank(bool blank)
 {
-#ifdef RECOVERY_LCD_BACKLIGHT_PATH
+#if defined(TW_NO_SCREEN_BLANK) && defined(TW_BRIGHTNESS_PATH) && defined(TW_MAX_BRIGHTNESS)
     int fd;
+    char brightness[4];
+    snprintf(brightness, 4, "%03d", TW_MAX_BRIGHTNESS/2);
 
-    fd = open(RECOVERY_LCD_BACKLIGHT_PATH, O_RDWR);
+    fd = open(TW_BRIGHTNESS_PATH, O_RDWR);
     if (fd < 0) {
         perror("cannot open LCD backlight");
         return;
     }
-    write(fd, blank ? "000" : "127", 3);
+    write(fd, blank ? "000" : brightness, 3);
     close(fd);
 #else
     int ret;
diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c
index fc34b6b..99f5841 100644
--- a/minuitwrp/graphics.c
+++ b/minuitwrp/graphics.c
@@ -69,6 +69,7 @@
 static GGLSurface gr_mem_surface;
 static unsigned gr_active_fb = 0;
 static unsigned double_buffering = 0;
+static int gr_is_curr_clr_opaque = 0;
 
 static int gr_fb_fd = -1;
 static int gr_vt_fd = -1;
@@ -288,6 +289,8 @@
     color[2] = ((b << 8) | b) + 1;
     color[3] = ((a << 8) | a) + 1;
     gl->color4xv(gl, color);
+
+    gr_is_curr_clr_opaque = (a == 255);
 }
 
 int gr_measureEx(const char *s, void* font)
@@ -463,8 +466,15 @@
 void gr_fill(int x, int y, int w, int h)
 {
     GGLContext *gl = gr_context;
+
+    if(gr_is_curr_clr_opaque)
+        gl->disable(gl, GGL_BLEND);
+
     gl->disable(gl, GGL_TEXTURE_2D);
     gl->recti(gl, x, y, x + w, y + h);
+
+    if(gr_is_curr_clr_opaque)
+        gl->enable(gl, GGL_BLEND);
 }
 
 void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) {
diff --git a/partition.cpp b/partition.cpp
index 541289a..95f6bca 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -361,10 +361,6 @@
 			Is_Storage = true;
 			Removable = true;
 			Wipe_Available_in_GUI = true;
-#ifndef RECOVERY_SDCARD_ON_DATA
-			Setup_AndSec();
-			Mount_Storage_Retry();
-#endif
 #endif
 		}
 #ifdef TW_INTERNAL_STORAGE_PATH
@@ -373,20 +369,12 @@
 			Is_Settings_Storage = true;
 			Storage_Path = EXPAND(TW_INTERNAL_STORAGE_PATH);
 			Wipe_Available_in_GUI = true;
-#ifndef RECOVERY_SDCARD_ON_DATA
-			Setup_AndSec();
-			Mount_Storage_Retry();
-#endif
 		}
 #else
 		if (Mount_Point == "/emmc" || Mount_Point == "/internal_sd" || Mount_Point == "/internal_sdcard") {
 			Is_Storage = true;
 			Is_Settings_Storage = true;
 			Wipe_Available_in_GUI = true;
-#ifndef RECOVERY_SDCARD_ON_DATA
-			Setup_AndSec();
-			Mount_Storage_Retry();
-#endif
 		}
 #endif
 	} else if (Is_Image(Fstab_File_System)) {
@@ -663,6 +651,7 @@
 	Backup_Path = Symlink_Mount_Point;
 	Make_Dir("/and-sec", true);
 	Recreate_AndSec_Folder();
+	Mount_Storage_Retry();
 }
 
 void TWPartition::Find_Real_Block_Device(string& Block, bool Display_Error) {
@@ -1602,12 +1591,6 @@
 	tar.setsize(Backup_Size);
 	if (tar.createTarFork() != 0)
 		return false;
-	if (use_encryption)
-		Full_FileName += "000";
-	if (TWFunc::Get_File_Size(Full_FileName) == 0) {
-		LOGERR("Backup file size for '%s' is 0 bytes.\n", Full_FileName.c_str());
-		return false;
-	}
 	return true;
 }
 
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 091ae32..04dbee9 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -96,6 +96,9 @@
 		for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
 			if ((*iter)->Is_Storage) {
 				(*iter)->Is_Settings_Storage = true;
+#ifndef RECOVERY_SDCARD_ON_DATA
+				(*iter)->Setup_AndSec();
+#endif
 				Found_Settings_Storage = true;
 				DataManager::SetValue("tw_settings_path", (*iter)->Storage_Path);
 				DataManager::SetValue("tw_storage_path", (*iter)->Storage_Path);
