diff --git a/src/org/alicebot/ab/Category.java b/src/org/alicebot/ab/Category.java
index 056752f..bfb0b7f 100644
--- a/src/org/alicebot/ab/Category.java
+++ b/src/org/alicebot/ab/Category.java
@@ -295,7 +295,7 @@ public static String categoryToAIML(Category category) {
String[] splitPattern = pattern.split(" ");
String rpattern = "";
for (String w : splitPattern) {
- if (w.startsWith("") || w.startsWith("") || w.startsWith("") || w.startsWith("") || w.startsWith("NAME=")) {
w = w.toLowerCase();
}
rpattern = rpattern + " " + w;
@@ -315,7 +315,7 @@ public static String categoryToAIML(Category category) {
if (!category.getThat().equals("*")) {
thatStatement = "" + category.getThat() + "";
}
- result = topicStart + "" + pattern + "" + thatStatement + NL + "" + category.getTemplate() + "" + NL + ""
+ result = topicStart + "" + pattern + "" + thatStatement + NL + "" + category.getTemplate().trim() + "" + NL + ""
+ topicEnd;
} catch (Exception ex) {
ex.printStackTrace();