diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index d6595070f1714e23e9c48897ebeec217007c36a1..9194539a5a0fa9b668f842ba1908c352141800a5 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -104,13 +104,13 @@ void printErrorInfo(ErrorInfo &einfo)
       }
     default: 
       {
-        levelString = "wat:";  
+        levelString = format("invalid error level: %1%") % einfo.level;  
         break;
       }
   }
 
   int ndl = prefix.length() + levelString.length() + 3 + einfo.name.length() + einfo.programName.value_or("").length();
-  int dashwidth = ndl > (errwidth - 3) ? 3 : 80 - ndl; 
+  int dashwidth = ndl > (errwidth - 3) ? 3 : errwidth - ndl; 
 
   string dashes;
   for (int i = 0; i < dashwidth; ++i)
@@ -161,7 +161,6 @@ void printErrorInfo(ErrorInfo &einfo)
     cout << prefix << *einfo.hint << endl;
     cout << prefix << endl;
   }
-
 }
 
 }