diff --git a/src/jastadd/ast/Attributes.jrag b/src/jastadd/ast/Attributes.jrag
index 86ed10fb7652310de9c34dd34966ead4d18b7e3f..dbedfee14f0b342e49136c98525203eadd5a2f1b 100644
--- a/src/jastadd/ast/Attributes.jrag
+++ b/src/jastadd/ast/Attributes.jrag
@@ -76,7 +76,7 @@ public aspect Attributes {
   }
 
   public void ASTNode.refineError(String what, String file, int line) {
-    grammar().error("can not find " + what + " to refine\n"
+    grammar().error("cannot find " + what + " to refine\n"
         + "Warning: implicitly generated methods and equations must be refined"
         + " without an explicit aspect name", file, line);
   }
@@ -98,7 +98,7 @@ public aspect Attributes {
       String aspectName) {
 
     if (!config().rewriteEnabled()) {
-      error("can not use rewrites while rewrites are disabled (enable with --rewrite=cnta)",
+      error("cannot use rewrites while rewrites are disabled (enable with --rewrite=cnta)",
           fileName, startLine);
       return;
     }
@@ -115,9 +115,9 @@ public aspect Attributes {
       r.setAspectName(aspectName);
       ((ASTDecl)c).addRewrite(r);
     } else if (c != null) {
-      error("can not rewrite to non AST class '" + className + "'", fileName, startLine);
+      error("cannot rewrite to non AST class '" + className + "'", fileName, startLine);
     } else {
-      error("can not rewrite to unknown class '" + className + "'", fileName, startLine);
+      error("cannot rewrite to unknown class '" + className + "'", fileName, startLine);
     }
   }
 
@@ -164,7 +164,7 @@ public aspect Attributes {
     TypeDecl type = lookup(decl.hostName);
     if (type == null) {
       problems.add(Problem.builder()
-          .message("can not find attribute %s in unknown class %s", decl.attrName, decl.hostName)
+          .message("cannot find attribute %s in unknown class %s", decl.attrName, decl.hostName)
           .sourceFile(decl.fileName)
           .sourceLine(decl.startLine)
           .buildError());
@@ -175,7 +175,7 @@ public aspect Attributes {
     if ((attr = type.lookupSynDecl(decl.signature)) == null
         && (attr = type.lookupInhDecl(decl.signature)) == null) {
       problems.add(Problem.builder()
-          .message("can not find attribute %s.%s", decl.hostName, decl.attrName)
+          .message("cannot find attribute %s.%s", decl.hostName, decl.attrName)
           .sourceFile(decl.fileName)
           .sourceLine(decl.startLine)
           .buildError());
@@ -361,7 +361,7 @@ public aspect Attributes {
       obj.modifiers = modifiers;
       c.classBodyDecls.add(obj);
     } else {
-      error("can not add member to unknown class " + className, fileName, n.firstToken.beginLine);
+      error("cannot add member to unknown class " + className, fileName, n.firstToken.beginLine);
     }
   }
 
@@ -451,7 +451,7 @@ public aspect Attributes {
       c.refinedSynEqs.add(equ);
       c.numRefinedSynEqs += 1;
     } else {
-      error("can not add equation for synthesized attribute " + name + " to unknown class "
+      error("cannot add equation for synthesized attribute " + name + " to unknown class "
           + className, fileName, startLine);
     }
   }
@@ -593,7 +593,7 @@ public aspect Attributes {
         c.refinedInhEqs.add(equ); // Sort in alphabetical order, then non-NTAs first.
         c.numRefinedInhEqs += 1;
     } else {
-      error("can not add equation for inherited attribute " + name + " to unknown class "
+      error("cannot add equation for inherited attribute " + name + " to unknown class "
           + className, fileName, startLine);
     }
   }
@@ -709,7 +709,7 @@ public aspect Attributes {
       c.refinedClassBodyDecls.add(o);
       c.numRefinedCBDecls += 1;
     } else {
-      error("can not add member to unknown class " + className + " in " + fileName);
+      error("cannot add member to unknown class " + className + " in " + fileName);
     }
   }
 
@@ -869,7 +869,8 @@ public aspect Attributes {
             buf.append("\\b)");
             pattern = buf.toString();
           }
-          String newContents = "refined_" + original.aspectName() + "_" + name() + "_" + methodName;
+          String newContents = String.format("refined_%s_%s_%s",
+              original.aspectName(), name(), methodName);
           // TODO: update keep to false if no strings are replaced.
 
           Matcher matcher = Pattern.compile(pattern).matcher(s);
diff --git a/src/jastadd/ast/Grammar.jrag b/src/jastadd/ast/Grammar.jrag
index 5ef93d5406aecadb55e055ed54227bd6a7a3a927..41ec465368db637ecc17fca9d46a40c2a95ea9a2 100644
--- a/src/jastadd/ast/Grammar.jrag
+++ b/src/jastadd/ast/Grammar.jrag
@@ -71,7 +71,7 @@ aspect Grammar {
         c.implementsList.add(nameList);
       } else {
         int line = nameList.firstToken.beginLine;
-        error("can not add interface to unknown class " + className, fileName, line);
+        error("cannot add interface to unknown class " + className, fileName, line);
       }
     }
   }
@@ -90,7 +90,7 @@ aspect Grammar {
         error(className + " is not an interface and can therefore not be extended", fileName, line);
       } else {
         int line = nameList.firstToken.beginLine;
-        error("can not add interface to unknown interface " + className, fileName, line);
+        error("cannot add interface to unknown interface " + className, fileName, line);
       }
     }
   }
diff --git a/src/jastadd/ast/NameBinding.jrag b/src/jastadd/ast/NameBinding.jrag
index 71250d8fb80a001d0e73d5fb4e511521c99e7d54..2cdf89124cb28ce063b8bd70632b5ff42ac1de39 100644
--- a/src/jastadd/ast/NameBinding.jrag
+++ b/src/jastadd/ast/NameBinding.jrag
@@ -163,7 +163,7 @@ aspect BindSynEquations {
 }
 
 aspect LookupDecls {
-  // This can not be lazy because we remove duplicate InhDecls,
+  // This cannot be lazy because we remove duplicate InhDecls,
   // so if this were lazy it could point to removed nodes!
   syn AttrDecl AttrEq.decl();
 
diff --git a/src/java/org/jastadd/JastAdd.java b/src/java/org/jastadd/JastAdd.java
index ce550654a38457ab2608e8262edb3e7143b269b4..125543e426505c88084733563649cf476154a66f 100644
--- a/src/java/org/jastadd/JastAdd.java
+++ b/src/java/org/jastadd/JastAdd.java
@@ -306,7 +306,7 @@ public class JastAdd {
           clazz.classBodyDecls.add(decl);
         } else {
           problems.add(Problem.builder()
-              .message("can not add member to unknown class %s", className)
+              .message("cannot add member to unknown class %s", className)
               .sourceFile(decl.fileName)
               .sourceLine(decl.line)
               .buildError());
@@ -325,7 +325,7 @@ public class JastAdd {
       TypeDecl clazz = grammar.lookup(className);
       if (clazz == null) {
         problems.add(decl.errorf(
-            "can not add synthesized attribute %s %s to unknown class %s",
+            "cannot add synthesized attribute %s %s to unknown class %s",
             decl.getType(), decl.getName(), className));
       }
     }
@@ -336,7 +336,7 @@ public class JastAdd {
         clazz.addSynEq(equ);
       } else {
         problems.add(equ.errorf(
-            "can not add equation for synthesized attribute %s to unknown class %s",
+            "cannot add equation for synthesized attribute %s to unknown class %s",
             equ.getName(), className));
       }
     }
@@ -348,7 +348,7 @@ public class JastAdd {
         clazz.addInhDecl(decl);
       } else {
         problems.add(decl.errorf(
-            "can not add inherited attribute %s %s to unknown class %s",
+            "cannot add inherited attribute %s %s to unknown class %s",
             decl.getType(), decl.getName(), className));
       }
     }
@@ -360,7 +360,7 @@ public class JastAdd {
         clazz.addInhEq(equ);
       } else {
         problems.add(equ.errorf(
-            "can not add equation for inhertied attribute %s to unknown class %s",
+            "cannot add equation for inhertied attribute %s to unknown class %s",
             equ.getName(), className));
       }
     }