Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 6534)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 6535)
@@ -255,7 +255,7 @@
 
     /**
-     * Prints a formated error message if logging is on. Calls {@link MessageFormat#format}
+     * Prints a formatted error message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
-     * @param msg The formated message to print.
+     * @param msg The formatted message to print.
      * @param objects The objects to insert into format string.
      * @since 6248
@@ -266,7 +266,7 @@
 
     /**
-     * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format}
+     * Prints a formatted warning message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
-     * @param msg The formated message to print.
+     * @param msg The formatted message to print.
      * @param objects The objects to insert into format string.
      */
@@ -276,7 +276,7 @@
 
     /**
-     * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format}
+     * Prints a formatted informational message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
-     * @param msg The formated message to print.
+     * @param msg The formatted message to print.
      * @param objects The objects to insert into format string.
      */
@@ -286,7 +286,7 @@
 
     /**
-     * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format}
+     * Prints a formatted debug message if logging is on. Calls {@link MessageFormat#format}
      * function to format text.
-     * @param msg The formated message to print.
+     * @param msg The formatted message to print.
      * @param objects The objects to insert into format string.
      */
@@ -302,4 +302,5 @@
     public static void error(Throwable t) {
         error(getErrorMessage(t));
+        t.printStackTrace();
     }
 
@@ -311,4 +312,5 @@
     public static void warn(Throwable t) {
         warn(getErrorMessage(t));
+        t.printStackTrace();
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6534)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6535)
@@ -79,4 +79,5 @@
     }
 
+    @SuppressWarnings("UnusedDeclaration")
     public static class Functions {
 
@@ -270,5 +271,5 @@
          */
         public String tag(String key) {
-            return env.osm.get(key);
+            return env.osm == null ? null : env.osm.get(key);
         }
 
@@ -278,9 +279,11 @@
         public String parent_tag(String key) {
             if (env.parent == null) {
-                // we don't have a matched parent, so just search all referrers
-                for (OsmPrimitive parent : env.osm.getReferrers()) {
-                    String value = parent.get(key);
-                    if (value != null) {
-                        return value;
+                if (env.osm != null) {
+                    // we don't have a matched parent, so just search all referrers
+                    for (OsmPrimitive parent : env.osm.getReferrers()) {
+                        String value = parent.get(key);
+                        if (value != null) {
+                            return value;
+                        }
                     }
                 }
