diff -Naur src.orig/freemarker/ext/jython/JythonHashModel.java src/freemarker/ext/jython/JythonHashModel.java
--- src.orig/freemarker/ext/jython/JythonHashModel.java	2007-04-21 01:06:15.000000000 +1200
+++ src/freemarker/ext/jython/JythonHashModel.java	2008-02-29 18:56:57.000000000 +1300
@@ -137,7 +137,7 @@
         {
             throw new TemplateModelException(e);
         }
-        throw new TemplateModelException("'?keys' is not supported as there is no 'keys' nor 'keySet' attribute on an instance of " + object.__class__.__name__);
+        throw new TemplateModelException("'?keys' is not supported as there is no 'keys' nor 'keySet' attribute on an instance of " + object.getType());
     }
 
     /**
@@ -157,6 +157,6 @@
         {
             throw new TemplateModelException(e);
         }
-        throw new TemplateModelException("'?values' is not supported as there is no 'values' attribute on an instance of " + object.__class__.__name__);
+        throw new TemplateModelException("'?values' is not supported as there is no 'values' attribute on an instance of " + object.getType());
     }
 }