Better error message from subprocess.Popen() and fix KeyError issue again