diff --git a/doc/variable.html b/doc/variable.html
index b2e760e21e..4e8eac6948 100644
--- a/doc/variable.html
+++ b/doc/variable.html
@@ -25,7 +25,7 @@
math functions = add(x,y), sub(x,y), mult(x,y), div(x,y),
neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
group functions = mass(group), charge(group), xcm(group,dim),
- vcm(group,dim), bounds(group,xmin), gyration(group)
+ vcm(group,dim), bound(group,xmin), gyration(group)
vectors = x[5], y[12], z[17], vx[88], vy[19], vz[2],
fx[1], fy[2005], fz[1]
keywords = same keywords (mostly) as in thermo_style custom command
diff --git a/doc/variable.txt b/doc/variable.txt
index 6d84f01b78..ddd430d49a 100644
--- a/doc/variable.txt
+++ b/doc/variable.txt
@@ -20,7 +20,7 @@ style = {index} or {loop} or {equal} or {world} or {universe} :l
math functions = add(x,y), sub(x,y), mult(x,y), div(x,y),
neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
group functions = mass(group), charge(group), xcm(group,dim),
- vcm(group,dim), bounds(group,xmin), gyration(group)
+ vcm(group,dim), bound(group,xmin), gyration(group)
vectors = x\[5\], y\[12\], z\[17\], vx\[88\], vy\[19\], vz\[2\],
fx\[1\], fy\[2005\], fz\[1\]
keywords = same keywords (mostly) as in "thermo_style custom"_thermo_style.html command
diff --git a/src/variable.cpp b/src/variable.cpp
index 8405739d09..6a0c0e9c8c 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -569,9 +569,9 @@ char *Variable::evaluate(char *str)
group->bounds(igroup,minmax);
if (strcmp(arg2,"xmin") == 0) answer = minmax[0];
else if (strcmp(arg2,"xmax") == 0) answer = minmax[1];
- if (strcmp(arg2,"ymin") == 0) answer = minmax[2];
+ else if (strcmp(arg2,"ymin") == 0) answer = minmax[2];
else if (strcmp(arg2,"ymax") == 0) answer = minmax[3];
- if (strcmp(arg2,"zmin") == 0) answer = minmax[4];
+ else if (strcmp(arg2,"zmin") == 0) answer = minmax[4];
else if (strcmp(arg2,"zmax") == 0) answer = minmax[5];
else error->all("Cannot evaluate variable equal command");