diff --git a/src/plugins/accounting_storage/mysql/as_mysql_job.c b/src/plugins/accounting_storage/mysql/as_mysql_job.c
index 9e1ec163026fcb6b25333a0453a1b5072fb87124..47a29fbb123c7acd97c31193455d83160901358e 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_job.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_job.c
@@ -349,11 +349,11 @@ no_rollup_change:
 		}
 #ifdef HAVE_BG
 		select_g_select_jobinfo_get(job_ptr->select_jobinfo,
-				     SELECT_JOBDATA_BLOCK_ID,
-				     &block_id);
+					    SELECT_JOBDATA_BLOCK_ID,
+					    &block_id);
 		select_g_select_jobinfo_get(job_ptr->select_jobinfo,
-				     SELECT_JOBDATA_NODE_CNT,
-				     &node_cnt);
+					    SELECT_JOBDATA_NODE_CNT,
+					    &node_cnt);
 #else
 		node_cnt = job_ptr->node_cnt;
 #endif
diff --git a/src/plugins/sched/wiki2/job_modify.c b/src/plugins/sched/wiki2/job_modify.c
index 1fc1320b62d810498358ce091369fcb4cea0ff23..97cd0e75c429f1a57cadf69cd99ff3453d351456 100644
--- a/src/plugins/sched/wiki2/job_modify.c
+++ b/src/plugins/sched/wiki2/job_modify.c
@@ -316,7 +316,19 @@ host_fini:	if (rc) {
 
 	if (new_node_cnt) {
 		job_desc_msg_t job_desc;
-
+#ifdef HAVE_BG
+		uint16_t geometry[SYSTEM_DIMENSIONS] = {(uint16_t) NO_VAL};
+		static uint16_t cpus_per_node = 0;
+		if (!cpus_per_node) {
+			select_g_alter_node_cnt(SELECT_GET_NODE_CPU_CNT,
+						&cpus_per_node);
+		}
+#endif
+		if(!IS_JOB_PENDING(job_ptr) || !job_ptr->details) {
+			error("wiki: MODIFYJOB node count of non-pending "
+			      "job %u", jobid);
+			return ESLURM_DISABLED;
+		}
 		memset(&job_desc, 0, sizeof(job_desc_msg_t));
 
 		job_desc.min_nodes = new_node_cnt;
@@ -327,41 +339,33 @@ host_fini:	if (rc) {
 
 		select_g_select_jobinfo_free(job_desc.select_jobinfo);
 
-		if (IS_JOB_PENDING(job_ptr) && job_ptr->details) {
-			job_ptr->details->min_nodes = job_desc.min_nodes;
-			if (job_ptr->details->max_nodes &&
-			   (job_ptr->details->max_nodes < job_desc.min_nodes))
-				job_ptr->details->max_nodes =
-					job_desc.min_nodes;
-			info("wiki: change job %u min_nodes to %u",
-				jobid, new_node_cnt);
+		job_ptr->details->min_nodes = job_desc.min_nodes;
+		if (job_ptr->details->max_nodes &&
+		    (job_ptr->details->max_nodes < job_desc.min_nodes))
+			job_ptr->details->max_nodes = job_desc.min_nodes;
+		info("wiki: change job %u min_nodes to %u",
+		     jobid, new_node_cnt);
 #ifdef HAVE_BG
-{
-			static uint16_t cpus_per_node = 0;
-
-			job_ptr->details->min_cpus = job_desc.min_cpus;
-			job_ptr->details->max_cpus = job_desc.max_cpus;
-			job_ptr->details->pn_min_cpus = job_desc.pn_min_cpus;
-
-			if (!cpus_per_node) {
-				select_g_alter_node_cnt(SELECT_GET_NODE_CPU_CNT,
-							&cpus_per_node);
-			}
-			new_node_cnt = job_ptr->num_procs;
-			if (cpus_per_node)
-				new_node_cnt /= cpus_per_node;
-			select_g_select_jobinfo_set(job_ptr->select_jobinfo,
-						    SELECT_JOBDATA_NODE_CNT,
-						    &new_node_cnt);
-}
+		job_ptr->details->min_cpus = job_desc.min_cpus;
+		job_ptr->details->max_cpus = job_desc.max_cpus;
+		job_ptr->details->pn_min_cpus = job_desc.pn_min_cpus;
+
+		new_node_cnt = job_ptr->details->min_cpus;
+		if (cpus_per_node)
+			new_node_cnt /= cpus_per_node;
+
+		/* This is only set up so accounting is set up correctly */
+		select_g_select_jobinfo_set(job_ptr->select_jobinfo,
+					    SELECT_JOBDATA_NODE_CNT,
+					    &new_node_cnt);
+		/* reset geo since changing this makes any geo
+		   potentially invalid */
+		select_g_select_jobinfo_set(job_ptr->select_jobinfo,
+					    SELECT_JOBDATA_GEOMETRY,
+					    geometry);
 #endif
-			last_job_update = now;
-			update_accounting = true;
-		} else {
-			error("wiki: MODIFYJOB node count of non-pending "
-				"job %u", jobid);
-			return ESLURM_DISABLED;
-		}
+		last_job_update = now;
+		update_accounting = true;
 	}
 
 	if (update_accounting) {
diff --git a/src/plugins/select/bluegene/plugin/jobinfo.c b/src/plugins/select/bluegene/plugin/jobinfo.c
index 194bf50d0adbc9ce7d2c901e3cd267c3af62cb2b..e71a68360b248ebc4016f94b3f7112834c2ff8f1 100644
--- a/src/plugins/select/bluegene/plugin/jobinfo.c
+++ b/src/plugins/select/bluegene/plugin/jobinfo.c
@@ -37,6 +37,7 @@
 \*****************************************************************************/
 
 #include "src/common/slurm_xlator.h"
+#include "bluegene.h"
 #include "jobinfo.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
@@ -112,6 +113,7 @@ extern int set_select_jobinfo(select_jobinfo_t *jobinfo,
 	uint16_t *uint16 = (uint16_t *) data;
 	uint32_t *uint32 = (uint32_t *) data;
 	char *tmp_char = (char *) data;
+	uint32_t new_size;
 
 	if (jobinfo == NULL) {
 		error("select_g_set_jobinfo: jobinfo not set");
@@ -124,8 +126,15 @@ extern int set_select_jobinfo(select_jobinfo_t *jobinfo,
 
 	switch (data_type) {
 	case SELECT_JOBDATA_GEOMETRY:
-		for (i=0; i<SYSTEM_DIMENSIONS; i++)
+		new_size = 1;
+		for (i=0; i<SYSTEM_DIMENSIONS; i++) {
 			jobinfo->geometry[i] = uint16[i];
+			new_size *= uint16[i];
+		}
+
+		/* Make sure the conn type is correct with the new count */
+		if((new_size > 1) && (jobinfo->conn_type == SELECT_SMALL))
+			jobinfo->conn_type = SELECT_TORUS;
 		break;
 	case SELECT_JOBDATA_REBOOT:
 		jobinfo->reboot = *uint16;
@@ -151,6 +160,13 @@ extern int set_select_jobinfo(select_jobinfo_t *jobinfo,
 		break;
 	case SELECT_JOBDATA_NODE_CNT:
 		jobinfo->node_cnt = *uint32;
+
+		/* Make sure the conn type is correct with the new count */
+		if((bg_conf->bp_node_cnt == bg_conf->nodecard_node_cnt)
+		   || (jobinfo->node_cnt < bg_conf->bp_node_cnt))
+			jobinfo->conn_type = SELECT_SMALL;
+		else if(jobinfo->conn_type == SELECT_SMALL)
+			jobinfo->conn_type = SELECT_TORUS;
 		break;
 	case SELECT_JOBDATA_ALTERED:
 		jobinfo->altered = *uint16;
diff --git a/src/plugins/select/bluegene/plugin/select_bluegene.c b/src/plugins/select/bluegene/plugin/select_bluegene.c
index 21df7a18dee0b0f72fe5daed1c2400dcb196a664..68dfb72834bd431ac11f95462b7a560e4700a9a2 100644
--- a/src/plugins/select/bluegene/plugin/select_bluegene.c
+++ b/src/plugins/select/bluegene/plugin/select_bluegene.c
@@ -1193,8 +1193,8 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data)
 		/* this means it is greater or equal to one bp */
 		if(tmp > 0) {
 			set_select_jobinfo(job_desc->select_jobinfo,
-					     SELECT_JOBDATA_NODE_CNT,
-					     &job_desc->min_nodes);
+					   SELECT_JOBDATA_NODE_CNT,
+					   &job_desc->min_nodes);
 			job_desc->min_nodes = tmp;
 			job_desc->min_cpus = bg_conf->cpus_per_bp * tmp;
 		} else {
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index e6b4a6544c30e1efd2086b3d056c806ae96bb812..0f9406f39e0e6f5ea9a50115fca2bd22b43c91d9 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -5516,9 +5516,16 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 		uint32_t node_cnt = detail_ptr->min_cpus;
 		if(cpus_per_node)
 			node_cnt /= cpus_per_node;
+		/* This is only set up so accounting is set up
+		   correctly */
 		select_g_select_jobinfo_set(job_ptr->select_jobinfo,
 					    SELECT_JOBDATA_NODE_CNT,
 					    &node_cnt);
+		/* reset geo since changing this makes any geo
+		   potentially invalid */
+		select_g_select_jobinfo_set(job_ptr->select_jobinfo,
+					    SELECT_JOBDATA_GEOMETRY,
+					    geometry);
 #endif
 		info("update_job: setting min_cpus from "
 		     "%u to %u for job_id %u",
@@ -5559,6 +5566,8 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 			uint32_t node_cnt = job_specs->num_tasks;
 			if(cpus_per_node)
 				node_cnt /= cpus_per_node;
+			/* This is only set up so accounting is set up
+			   correctly */
 			select_g_select_jobinfo_set(job_ptr->select_jobinfo,
 						    SELECT_JOBDATA_NODE_CNT,
 						    &node_cnt);
@@ -5784,7 +5793,7 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 			     job_specs->job_id);
 			update_accounting = true;
 		} else {
-			error("sched: Attempt to increase job_min_cpus for "
+			error("sched: Attempt to increase nice for "
 			      "job %u", job_specs->job_id);
 			error_code = ESLURM_ACCESS_DENIED;
 		}
@@ -5990,7 +5999,7 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 	}
 
 #ifndef HAVE_BG
-	if (job_specs->req_nodes && 
+	if (job_specs->req_nodes &&
 	    (IS_JOB_RUNNING(job_ptr) || IS_JOB_SUSPENDED(job_ptr))) {
 		/* Use req_nodes to change the nodes associated with a running
 		 * for lack of other field in the job request to use */
@@ -6100,7 +6109,8 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 		if ((!IS_JOB_PENDING(job_ptr)) || (detail_ptr == NULL))
 			error_code = ESLURM_DISABLED;
 		else if (super_user) {
-			detail_ptr->ntasks_per_node = job_specs->ntasks_per_node;
+			detail_ptr->ntasks_per_node =
+				job_specs->ntasks_per_node;
 			info("sched: update_job: setting ntasks_per_node to %u"
 			     " for job_id %u", job_specs->ntasks_per_node,
 			     job_specs->job_id);
@@ -6116,7 +6126,7 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 			error_code = ESLURM_DISABLED;
 		else {
 			int rc;
-			rc = update_job_dependency(job_ptr, 
+			rc = update_job_dependency(job_ptr,
 						   job_specs->dependency);
 			if (rc != SLURM_SUCCESS)
 				error_code = rc;