--- zenencfs-0.1/zenencfs	2016-08-04 10:36:08.000000000 +0200
+++ zenencfs-0.2.1/zenencfs	2016-08-06 10:15:19.155899871 +0200
@@ -7,7 +7,12 @@
 
 # zenencfs is a simple GTK/NCURSES frontend to encfs
 # Version 0.1 - Thu Aug  4 10:35:57 CEST 2016
+# Version 0.2 - Fri Aug  5 22:54:25 CEST 2016
+# Version 0.2.1 - Sat Aug  6 10:12:42 CEST 2016
+
 
+# Default CLI options
+ENCFS="/usr/bin/encfs --standard"
 
 # Take a look at "Xdialog" and use it instead of "dialog" in case X is running
 if [[ "$DISPLAY" && "$(which Xdialog 2>&1 | grep -v "which: no")" ]]; then
@@ -70,7 +75,8 @@
 			--yesno "$(eval_gettext 'Closing ENCFS Folder') \"$path/$foldernoext\"" 10 75 
 	[ $? != 0 ] && exit 1
 	mountpoint="$(/bin/mount | grep "^encfs.*$path/$foldernoext.*" | sed -n 's|^encfs on \(.*\) type .*|\1|p')"
-	fusermount -u "$mountpoint" && rmdir "$mountpoint"
+	fusermount -u -z "$mountpoint" && rmdir "$mountpoint"  \
+		|| $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Failed to close ENCFS Folder') \"$folderext\"" 10 75 
 else
 	if [ -d "$path/$folderext" ]; then
 		password="$($dialog \
@@ -78,20 +84,23 @@
 				$pwdialogoptions "$(eval_gettext 'Enter password to open ENCFS Folder') \"$path/$folderext\"" 12 75)"
 		[ $? != 0 ] && exit 1
 		mkdir -p "$path/$foldernoext"
-		echo -n $password |  encfs --standard --stdinpass "$path/$folderext" "$path/$foldernoext"
+		echo -n "$password" |  $ENCFS --stdinpass "$path/$folderext" "$path/$foldernoext" \
+		|| $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Failed to open ENCFS Folder') \"$folderext\"" 10 75 && rmdir "$path/$foldernoext"
 	else
 		password="$($dialog \
 				--title "$(eval_gettext 'ENCFS Create')" \
 				$pwdialogoptions "$(eval_gettext 'Enter password to create ENCFS Folder') \"$path/$folderext\"" 12 75)"
 		[ $? != 0 ] && exit 1
+		[ ! "$password" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Null passwords are not allowed')" 10 75 && exit 1
 		mkdir -p "$path/$folderext"
 		mkdir -p "$path/$foldernoext.TMP"
-		echo -n $password |  encfs --standard --stdinpass "$path/$folderext" "$path/$foldernoext.TMP"
+		echo -n "$password" |  $ENCFS --stdinpass "$path/$folderext" "$path/$foldernoext.TMP" \
+		|| $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Failed to create ENCFS Folder') \"$folderext\"" 10 75 
 		if [ -d "$path/$foldernoext" ]; then
 			cp -rf "$path/$foldernoext"/* "$path/$foldernoext.TMP"
 			mountpoint="$(/bin/mount | grep "^encfs.*$path/$foldernoext.*" | sed -n 's|^encfs on \(.*\) type .*|\1|p')"
-			fusermount -u "$mountpoint" && rmdir "$mountpoint"
-			$dialog --title "$(eval_gettext 'Done')" --msgbox "$(eval_gettext 'Done copying data to ENCFS Folder') \"$folderext\"" 8 65 
+			fusermount -u -z "$mountpoint" && rmdir "$mountpoint"
+			$dialog --title "$(eval_gettext 'Done')" --msgbox "$(eval_gettext 'Done copying data to ENCFS Folder') \"$folderext\"" 10 75 
 		fi
 	fi
 fi
