diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index <HASH>..<HASH> 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -280,10 +280,10 @@ class ExternalCommand(Command):
                 ret = str(e)
             else:
                 _, err = await proc.communicate(stdin.read() if stdin else None)
-            if proc.returncode == 0:
-                ret = 'success'
-            elif err:
-                ret = err.decode(urwid.util.detected_encoding)
+                if proc.returncode == 0:
+                    ret = 'success'
+                elif err:
+                    ret = err.decode(urwid.util.detected_encoding)
         else:
             with ui.paused():
                 try:
diff --git a/alot/helper.py b/alot/helper.py
index <HASH>..<HASH> 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -302,7 +302,7 @@ async def call_cmd_async(cmdlist, stdin=None, env=None):
     handle.
 
     If such an `OSError` is caught, then returncode will be set to 1, and the
-    error value will be set to the str() method fo the exception.
+    error value will be set to the str() value of the exception.
 
     :type cmdlist: list of str
     :param stdin: string to pipe to the process
Fix UnboundLocalError

The local variable proc was not defined in these branches.