diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index c3d55d76a41c8b0e53dc0e45598f2a611eab65c4..ddbf2e6b5953fbb56764377a6331168c98b0b62e 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -68,6 +68,7 @@ void CreateAtoms::command(int narg, char **arg)
   if (strcmp(arg[1],"box") == 0) {
     style = BOX;
     iarg = 2;
+    nregion = -1;
   } else if (strcmp(arg[1],"region") == 0) {
     style = REGION;
     if (narg < 3) error->all(FLERR,"Illegal create_atoms command");
@@ -727,7 +728,7 @@ void CreateAtoms::add_lattice()
 
   // narrow down min/max further by extent of the region, if possible
 
-  if (domain->regions[nregion]->bboxflag) {
+  if ((style == REGION) && domain->regions[nregion]->bboxflag) {
     const double rxmin = domain->regions[nregion]->extent_xlo;
     const double rxmax = domain->regions[nregion]->extent_xhi;
     const double rymin = domain->regions[nregion]->extent_ylo;