diff --git a/src/helma/framework/core/Prototype.java b/src/helma/framework/core/Prototype.java
index 7aa77a74..c5f6bd38 100644
--- a/src/helma/framework/core/Prototype.java
+++ b/src/helma/framework/core/Prototype.java
@@ -88,7 +88,7 @@ public final class Prototype {
         lowerCaseName = name.toLowerCase();
 
         // Create and register type properties file
-        props = new ResourceProperties();
+        props = new ResourceProperties(app);
         if (repository != null) {
             props.addResource(repository.getResource("type.properties"));
         }
diff --git a/src/helma/util/ResourceProperties.java b/src/helma/util/ResourceProperties.java
index 964f81cd..e87662fd 100644
--- a/src/helma/util/ResourceProperties.java
+++ b/src/helma/util/ResourceProperties.java
@@ -65,6 +65,14 @@ public final class ResourceProperties extends Properties {
         resources = new HashSet();
     }
 
+    /**
+     * Constructs an empty ResourceProperties
+     * Resources must be added manually afterwards
+     */
+    public ResourceProperties(Application app) {
+        resources = new TreeSet(app.getResourceComparator());
+    }
+
     /**
      * Constructs a ResourceProperties retrieving resources from the given
      * application using the given name to fetch resources
@@ -159,7 +167,7 @@ public final class ResourceProperties extends Properties {
 
             /* next we try to load properties from the application's
              repositories, if we blong to any application */
-            if (app != null) {
+            if (resourceName != null) {
                 Iterator iterator = app.getRepositories().iterator();
                 while (iterator.hasNext()) {
                     try {
@@ -266,7 +274,7 @@ public final class ResourceProperties extends Properties {
     public long getChecksum() {
         long checksum = 0;
 
-        if (app != null) {
+        if (resourceName != null) {
             Iterator iterator = app.getRepositories().iterator();
             while (iterator.hasNext()) {
                 try {