diff --git a/src/channel.c b/src/channel.c
index 3fdd312..d5240fc 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4787,8 +4787,8 @@
 		if (!(supported & JO_OUT_IO))
 		    break;
 		opt->jo_set |= JO_OUT_NAME << (part - PART_OUT);
-		opt->jo_io_name[part] =
-		       tv_get_string_buf_chk(item, opt->jo_io_name_buf[part]);
+		opt->jo_io_name[part] = tv_get_string_buf_chk(item,
+						   opt->jo_io_name_buf[part]);
 	    }
 	    else if (STRCMP(hi->hi_key, "pty") == 0)
 	    {
@@ -4953,7 +4953,8 @@
 		if (!(supported2 & JO2_TERM_NAME))
 		    break;
 		opt->jo_set2 |= JO2_TERM_NAME;
-		opt->jo_term_name = tv_get_string_chk(item);
+		opt->jo_term_name = tv_get_string_buf_chk(item,
+						       opt->jo_term_name_buf);
 		if (opt->jo_term_name == NULL)
 		{
 		    semsg(_(e_invargval), "term_name");
@@ -4980,7 +4981,8 @@
 		if (!(supported2 & JO2_TERM_OPENCMD))
 		    break;
 		opt->jo_set2 |= JO2_TERM_OPENCMD;
-		p = opt->jo_term_opencmd = tv_get_string_chk(item);
+		p = opt->jo_term_opencmd = tv_get_string_buf_chk(item,
+						    opt->jo_term_opencmd_buf);
 		if (p != NULL)
 		{
 		    // Must have %d and no other %.
@@ -4997,13 +4999,12 @@
 	    }
 	    else if (STRCMP(hi->hi_key, "eof_chars") == 0)
 	    {
-		char_u *p;
-
 		if (!(supported2 & JO2_EOF_CHARS))
 		    break;
 		opt->jo_set2 |= JO2_EOF_CHARS;
-		p = opt->jo_eof_chars = tv_get_string_chk(item);
-		if (p == NULL)
+		opt->jo_eof_chars = tv_get_string_buf_chk(item,
+						       opt->jo_eof_chars_buf);
+		if (opt->jo_eof_chars == NULL)
 		{
 		    semsg(_(e_invargval), "eof_chars");
 		    return FAIL;
@@ -5082,7 +5083,13 @@
 		if (!(supported2 & JO2_TERM_KILL))
 		    break;
 		opt->jo_set2 |= JO2_TERM_KILL;
-		opt->jo_term_kill = tv_get_string_chk(item);
+		opt->jo_term_kill = tv_get_string_buf_chk(item,
+						       opt->jo_term_kill_buf);
+		if (opt->jo_term_kill == NULL)
+		{
+		    semsg(_(e_invargval), "term_kill");
+		    return FAIL;
+		}
 	    }
 	    else if (STRCMP(hi->hi_key, "tty_type") == 0)
 	    {
@@ -5157,7 +5164,12 @@
 		    break;
 		opt->jo_set2 |= JO2_TERM_API;
 		opt->jo_term_api = tv_get_string_buf_chk(item,
-							 opt->jo_term_api_buf);
+							opt->jo_term_api_buf);
+		if (opt->jo_term_api == NULL)
+		{
+		    semsg(_(e_invargval), "term_api");
+		    return FAIL;
+		}
 	    }
 #endif
 	    else if (STRCMP(hi->hi_key, "env") == 0)
@@ -5247,7 +5259,7 @@
 		    break;
 		opt->jo_set |= JO_STOPONEXIT;
 		opt->jo_stoponexit = tv_get_string_buf_chk(item,
-							     opt->jo_soe_buf);
+						      opt->jo_stoponexit_buf);
 		if (opt->jo_stoponexit == NULL)
 		{
 		    semsg(_(e_invargval), "stoponexit");
@@ -5817,7 +5829,7 @@
 	typval_T    *argvars,
 	char	    **argv_arg UNUSED,
 	jobopt_T    *opt_arg,
-	int	    is_terminal UNUSED)
+	job_T	    **term_job)
 {
     job_T	*job;
     char_u	*cmd = NULL;
@@ -5968,6 +5980,9 @@
     // Save the command used to start the job.
     job->jv_argv = argv;
 
+    if (term_job != NULL)
+	*term_job = job;
+
 #ifdef USE_ARGV
     if (ch_log_active())
     {
@@ -5984,7 +5999,7 @@
 	ch_log(NULL, "Starting job: %s", (char *)ga.ga_data);
 	ga_clear(&ga);
     }
-    mch_job_start(argv, job, &opt, is_terminal);
+    mch_job_start(argv, job, &opt, term_job != NULL);
 #else
     ch_log(NULL, "Starting job: %s", (char *)cmd);
     mch_job_start((char *)cmd, job, &opt);
@@ -6600,7 +6615,7 @@
     rettv->v_type = VAR_JOB;
     if (check_restricted() || check_secure())
 	return;
-    rettv->vval.v_job = job_start(argvars, NULL, NULL, FALSE);
+    rettv->vval.v_job = job_start(argvars, NULL, NULL, NULL);
 }
 
 /*
