diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag
index 2a9c80321f00a52279c10f8d3b5c201f42636fbf..a155ba6933c363acb94226f42710ffcb4be39c61 100644
--- a/CompilerGeneration.jrag
+++ b/CompilerGeneration.jrag
@@ -102,6 +102,8 @@ aspect AbsGrammarGeneration {
 			// Thing is handled explicitly
 			return;
 		}
+		System.out.println(name());
+		dumpTree(" ",System.out);
 		pStream.print(name());
 		pStream.print(" : "+getSuperClass().name());	
 		pStream.print(" ::=");
diff --git a/Names.jrag b/Names.jrag
index c698d4d4994b94a73943e98b9b63ea13fe7fa371..c5b6a402566c59d8073c568312656f4a0f16d865 100644
--- a/Names.jrag
+++ b/Names.jrag
@@ -1,7 +1,7 @@
 /* -*-Java-*- */
 
 /* 
- * Copyright (C) 2006,2010  Anders Nilsson <anders.nilsson@control.lth.se>
+ * Copyright (C) 2006,2010,2014  Anders Nilsson <anders.nilsson@control.lth.se>
  *
  * This file is part of OntologyCompiler.
  *
diff --git a/Rewrites.jrag b/Rewrites.jrag
index ceb5cbe657c6629e02d632bdcc1e10a5dc39f7c1..24d5f9cf924c9b0f31d604cbb63de18197455ee8 100644
--- a/Rewrites.jrag
+++ b/Rewrites.jrag
@@ -30,6 +30,7 @@ aspect MiscUtilities {
 
     syn lazy String Attribute.trim() {
 		String s = getValue().getSTRING_LITERAL();
+		s.replaceAll("&iml;","");
 		if (s.indexOf('"') == 0) {
 			s = s.substring(1,s.length()-1).trim();
 		} 
@@ -226,7 +227,12 @@ aspect MiscUtilities {
 		return (ComplexElement) e;
     }
 
-	syn boolean Declaration.isClassDecl() = getElement(0).isClass();
+	 syn boolean Declaration.isClassDecl() {
+		  dumpTree(" ",System.out);
+		  return getElement(0).isClass();
+	 }
+	eq OwlClassDecl.isClassDecl() = true;
+	eq OwlClassUse.isClassDecl() = false;
 	eq ClassDeclaration.isClassDecl() = false;
 	eq IndividualDeclaration.isClassDecl() = false;
 	syn boolean Declaration.isIndividualDecl() = getElement(0).isIndividual();
@@ -243,20 +249,22 @@ aspect MiscUtilities {
 
 aspect RewriteClasses {
 
-	rewrite Declaration {
-		when (isClassDecl())
-			to ClassDeclaration {
-			ClassDeclaration c = new ClassDeclaration();
-			c.setElementList(getElementList());
-			return c;
-		}
-		// when (isIndividualDecl())
-		// 	to IndividualDeclaration {
-		// 	IndividualDeclaration c = new IndividualDeclaration();
-		// 	c.setElementList(getElementList());
-		// 	return c;
-		// }
-	}
+	// rewrite OClass {
+	// 	when (isClassDecl())
+	// 		to ClassDeclaration {
+	// 		 System.out.println(getId());
+	// 		ClassDeclaration c = new ClassDeclaration();
+	// 		c.setElementList(getElementList());
+	// 		c.setAttributeList(getAttributeList());
+	// 		return c;
+	// 	}
+	// 	// when (isIndividualDecl())
+	// 	// 	to IndividualDeclaration {
+	// 	// 	IndividualDeclaration c = new IndividualDeclaration();
+	// 	// 	c.setElementList(getElementList());
+	// 	// 	return c;
+	// 	// }
+	// }
 
     rewrite OwlClass {
 		when (isTopLevel())