diff --git a/NEWS b/NEWS
index e7bc213e0eefbb4b9c6413b7f98c0bd41077922b..f7fb85661d49fbe3dd0dcf7b3c044df52491422a 100644
--- a/NEWS
+++ b/NEWS
@@ -294,6 +294,8 @@ documents those changes that are of interest to users and administrators.
  -- If node boot in progress when slurmctld daemon is restarted, then allow
     sufficient time for reboot to complete and not prematurely DOWN the node as
     "Not responding".
+ -- For job resize, correct logic to build "resize" script with new values.
+    Previously the scripts were based upon the original job size.
 
 * Changes in Slurm 16.05.9
 ==========================
@@ -1070,6 +1072,8 @@ documents those changes that are of interest to users and administrators.
 
 * Changes in Slurm 15.08.14
 ===========================
+ -- For job resize, correct logic to build "resize" script with new values.
+    Previously the scripts were based upon the original job size.
 
 * Changes in Slurm 15.08.13
 ===========================
diff --git a/src/scontrol/update_job.c b/src/scontrol/update_job.c
index a99726e8f77890367d6697c6670165ef4aa42d5e..7efca577d5f9a20ff74669f5c24f504798b9cdc6 100644
--- a/src/scontrol/update_job.c
+++ b/src/scontrol/update_job.c
@@ -1271,16 +1271,17 @@ extern int scontrol_update_job(int argc, char **argv)
 	if (update_size && !_is_single_job(job_msg.job_id_str)) {
 		exit_code = 1;
 		return 0;
-	} else if (update_size) {
-		/* See check above for one job ID */
-		job_msg.job_id = slurm_atoul(job_msg.job_id_str);
-		_update_job_size(job_msg.job_id);
 	}
 
 	if (_is_job_id(job_msg.job_id_str)) {
 		job_msg.job_id_str = _next_job_id();
 		while (job_msg.job_id_str) {
 			rc2 = slurm_update_job2(&job_msg, &resp);
+			if (update_size && (rc2 == SLURM_SUCCESS)) {
+				/* See check above for one job ID */
+				job_msg.job_id = slurm_atoul(job_msg.job_id_str);
+				_update_job_size(job_msg.job_id);
+			}
 			if (rc2 != SLURM_SUCCESS) {
 				rc2 = slurm_get_errno();
 				rc = MAX(rc, rc2);
@@ -1421,7 +1422,13 @@ static void _update_job_size(uint32_t job_id)
 		xfree(tmp);
 	}
 	if (getenv("SLURM_TASKS_PER_NODE")) {
-		/* We don't have sufficient information to recreate this */
+		/* We don't have sufficient information to recreate these */
+		fprintf(resize_sh, "unset SLURM_NPROCS\n");
+		fprintf(resize_csh, "unsetenv SLURM_NPROCS\n");
+
+		fprintf(resize_sh, "unset SLURM_NTASKS\n");
+		fprintf(resize_csh, "unsetenv SLURM_NTASKS\n");
+
 		fprintf(resize_sh, "unset SLURM_TASKS_PER_NODE\n");
 		fprintf(resize_csh, "unsetenv SLURM_TASKS_PER_NODE\n");
 	}