diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp
index dff62c80804de0955622045af6a81d59c971ffe2..5f6f68d12a7b68ea166df8576f84bd0c600dfd05 100644
--- a/src/KSPACE/msm.cpp
+++ b/src/KSPACE/msm.cpp
@@ -2265,7 +2265,7 @@ void MSM::restriction(int n)
 {
   //fprintf(screen,"Restricting from level %i to %i\n\n",n,n+1);
 
-  int p = order-1;
+  const int p = order-1;
 
   double ***qgrid1 = qgrid[n];
   double ***qgrid2 = qgrid[n+1];
@@ -2287,7 +2287,8 @@ void MSM::restriction(int n)
 
   // zero out charge on coarser grid
 
-  memset(&(qgrid2[nzlo_out[n+1]][nylo_out[n+1]][nxlo_out[n+1]]),0,ngrid[n+1]*sizeof(double));
+  memset(&(qgrid2[nzlo_out[n+1]][nylo_out[n+1]][nxlo_out[n+1]]),0,
+         ngrid[n+1]*sizeof(double));
 
   for (kp = nzlo_in[n+1]; kp <= nzhi_in[n+1]; kp++)
     for (jp = nylo_in[n+1]; jp <= nyhi_in[n+1]; jp++)
@@ -2338,7 +2339,7 @@ void MSM::prolongation(int n)
 {
   //fprintf(screen,"Prolongating from level %i to %i\n\n",n+1,n);
 
-  int p = order-1;
+  const int p = order-1;
 
   double ***egrid1 = egrid[n];
   double ***egrid2 = egrid[n+1];
diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp
index 3076bb2deda7bc6ff1c95bd7124e83e025f67751..3549c1676f883a88813bbea4c2117be0157d4aeb 100644
--- a/src/displace_atoms.cpp
+++ b/src/displace_atoms.cpp
@@ -215,7 +215,7 @@ void DisplaceAtoms::command(int narg, char **arg)
     axis[1] = force->numeric(FLERR,arg[6]);
     axis[2] = force->numeric(FLERR,arg[7]);
     double theta = force->numeric(FLERR,arg[8]);
-    if (dim == 2 and (axis[0] != 0.0 || axis[1] != 0.0))
+    if (dim == 2 && (axis[0] != 0.0 || axis[1] != 0.0))
       error->all(FLERR,"Invalid displace_atoms rotate axis for 2d");
 
     double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
diff --git a/src/input.cpp b/src/input.cpp
index 0a5be3a9a6e8a845f0b83a1065da00f166f98dde..578fe178881fc3e5d156ae71dfb23d20dbc85f7f 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -200,7 +200,7 @@ void Input::file()
     // execute the command
 
     if (execute_command()) {
-      char str[maxline+32];
+      char *str = new char[maxline+32];
       sprintf(str,"Unknown command: %s",line);
       error->all(FLERR,str);
     }
@@ -266,7 +266,7 @@ char *Input::one(const char *single)
   // execute the command and return its name
 
   if (execute_command()) {
-    char str[maxline+32];
+    char *str = new char[maxline+32];
     sprintf(str,"Unknown command: %s",line);
     error->all(FLERR,str);
   }
diff --git a/src/variable.cpp b/src/variable.cpp
index cfd16b6471191a39b7832b705fc8569062b4919d..406da2474a05dafc5b6c131527f27bbd0cff6685 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -3618,7 +3618,7 @@ unsigned int Variable::data_mask(char *str)
     // compute
     // ----------------
 
-    if ((strncmp(word,"c_",2) == 0) && (i>0) && (not isalnum(str[i-1]))){
+    if ((strncmp(word,"c_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
       if (domain->box_exist == 0)
         error->all(FLERR,
                    "Variable evaluation before simulation box is defined");
@@ -3636,7 +3636,7 @@ unsigned int Variable::data_mask(char *str)
       delete [] id;
     }
 
-    if ((strncmp(word,"f_",2) == 0) && (i>0) && (not isalnum(str[i-1]))) {
+    if ((strncmp(word,"f_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
         if (domain->box_exist == 0)
           error->all(FLERR,
                      "Variable evaluation before simulation box is defined");
@@ -3652,7 +3652,7 @@ unsigned int Variable::data_mask(char *str)
         delete [] id;
     }
 
-    if ((strncmp(word,"v_",2) == 0) && (i>0) && (not isalnum(str[i-1]))) {
+    if ((strncmp(word,"v_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
       int ivar = find(word);
       datamask &= data_mask(ivar);
     }