diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index c37106a755c60bc1451eb6f6f54b469e864f89fb..4aedfbcdea9a5ed230c72c79beb8fc441b6f0f03 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -2161,7 +2161,7 @@ static bool _opt_verify(void)
 		setenv("SLURM_JOB_NAME", opt.job_name, 0);
 
 	/* check for realistic arguments */
-	if (opt.ntasks <= 0) {
+	if (opt.ntasks < 0) {
 		error("invalid number of tasks (-n %d)", opt.ntasks);
 		verified = false;
 	}
diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c
index 939b9472eb0a39add34034076eb9f9aea38d391c..964d5e42734b3a499fd20addacc52fbad712f31a 100644
--- a/src/sbatch/sbatch.c
+++ b/src/sbatch/sbatch.c
@@ -281,12 +281,14 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 	desc->req_nodes = opt.nodelist;
 	desc->exc_nodes = opt.exc_nodes;
 	desc->partition = opt.partition;
-	if (opt.nodes_set || opt.min_nodes)
-		desc->min_nodes = opt.min_nodes;
 	if (opt.licenses)
 		desc->licenses = xstrdup(opt.licenses);
-	if (opt.nodes_set || opt.max_nodes)
-		desc->max_nodes = opt.max_nodes;
+	if (opt.nodes_set) {
+		desc->min_nodes = opt.min_nodes;
+		if (opt.max_nodes)
+			desc->max_nodes = opt.max_nodes;
+	} else if (opt.ntasks_set && (opt.ntasks == 0))
+		desc->min_nodes = 0;
 	if (opt.ntasks_per_node)
 		desc->ntasks_per_node = opt.ntasks_per_node;
 	desc->user_id = opt.uid;