Added checks for missing editor and returncode.