diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index 9fb32a4..b5930a6 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -145,9 +145,10 @@
 
     // Some initializations ...
     {
-        Properties prop = loadProperties();
-        this.version = prop.getProperty("krill.version");
-        this.name = prop.getProperty("krill.name");
+        Properties prop    = loadProperties();
+        Properties version = loadInfo();
+        this.version = version.getProperty("krill.version");
+        this.name = version.getProperty("krill.name");
 
         // Check for auto commit value
         String stringProp = prop.getProperty("krill.index.commit.auto");
diff --git a/src/main/java/de/ids_mannheim/korap/index/Indexer.java b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
index 9c528a7..4eed08a 100644
--- a/src/main/java/de/ids_mannheim/korap/index/Indexer.java
+++ b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
@@ -23,7 +23,7 @@
     int count;
     int commitCount;
 
-    private static String propFile = "krill.properties";
+    // private static String propFile = "krill.properties";
     private static String path = null;
 
     // Init logger
@@ -116,15 +116,37 @@
      */
     public static void main (String[] argv) throws IOException {
 
+        if (argv.length == 0) {
+            /*
+          String jar = new File(Indexer.class.getProtectionDomain()
+          .getCodeSource().getLocation().getPath()).getName();
+          System.out.println("Usage: java -jar " + jar
+          + "--config [propfile] [directories]*");
+          return;
+            */
+
+            System.err.println("Call with parameters:");
+            System.err.println("--config|-c      Configuration file (defaults to " +
+                               de.ids_mannheim.korap.util.KrillProperties.file +
+                               ")");
+            System.err.println("--indexDir|-d    Index directory "+
+                               "(defaults to krill.indexDir in configuration)");
+            System.err.println();
+            return;
+        };
+
         int i = 0;
         boolean last = false;
+        String propFile = null;
+
         for (i = 0; i < argv.length; i += 2) {
             switch (argv[i]) {
                 case "--config":
                 case "-cfg":
+                case "-c":
                     propFile = argv[i + 1];
                     break;
-                case "--dir":
+                case "--indexDir":
                 case "-d":
                     path = argv[i + 1];
                     break;
@@ -137,14 +159,6 @@
                 break;
         };
 
-        /*
-          String jar = new File(Indexer.class.getProtectionDomain()
-          .getCodeSource().getLocation().getPath()).getName();
-          System.out.println("Usage: java -jar " + jar
-          + "--config [propfile] [directories]*");
-          return;
-        */
-
         // Load properties
         /*
           InputStream fr = new FileInputStream(argv[0]);
diff --git a/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java b/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java
index 551fc0c..6d1aec8 100644
--- a/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java
+++ b/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java
@@ -9,39 +9,49 @@
 // Todo: Properties may be loaded twice - althogh Java may cache automatically
 public class KrillProperties {
 
+    public static String file = "krill.properties";
+    private static String info = "krill.info";
+    private static Properties prop;
+
     // Logger
     private final static Logger log = LoggerFactory.getLogger(Krill.class);
 
 
     // Load properties from file
     public static Properties loadProperties () {
-        return loadProperties("krill.properties");
+        if (prop != null)
+            return prop;
+
+        prop = loadProperties(file);
+        return prop;
     };
 
 
     // Load properties from file
     public static Properties loadProperties (String propFile) {
-        InputStream file;
-        Properties prop;
+        if (propFile == null)
+            return loadProperties();
+
+        InputStream iFile;
         try {
-            file = new FileInputStream(propFile);
+            iFile = new FileInputStream(propFile);
             prop = new Properties();
-            prop.load(file);
+            prop.load(iFile);
         }
         catch (IOException t) {
             try {
-                file = KrillProperties.class.getClassLoader()
-                        .getResourceAsStream(propFile);
+                iFile = KrillProperties.class.getClassLoader()
+                    .getResourceAsStream(propFile);
 
-                if (file == null) {
+                if (iFile == null) {
                     log.error(
-                            "Cannot find {}. Please create it using \"{}.info\" as template.",
-                            propFile, propFile);
+                              "Cannot find {}. Please create it using \"{}.info\" as template.",
+                              propFile, propFile);
                     return null;
                 };
 
                 prop = new Properties();
-                prop.load(file);
+                prop.load(iFile);
             }
             catch (IOException e) {
                 log.error(e.getLocalizedMessage());
@@ -50,4 +60,20 @@
         };
         return prop;
     };
+
+
+    // Load version info from file
+    public static Properties loadInfo () {
+        try {
+            InputStream iFile = KrillProperties.class.getClassLoader()
+                .getResourceAsStream(info);
+            Properties prop = new Properties();
+            prop.load(iFile);
+        }
+        catch (IOException e) {
+            log.error(e.getLocalizedMessage());
+            return null;
+        };
+        return prop;
+    };
 };
diff --git a/src/main/resources/krill.info b/src/main/resources/krill.info
new file mode 100644
index 0000000..f9cbc50
--- /dev/null
+++ b/src/main/resources/krill.info
@@ -0,0 +1,2 @@
+krill.version = ${project.version}
+krill.name = ${project.name}
diff --git a/src/main/resources/krill.properties.info b/src/main/resources/krill.properties.info
index b9fcc72..2f4871f 100644
--- a/src/main/resources/krill.properties.info
+++ b/src/main/resources/krill.properties.info
@@ -1,6 +1,3 @@
-krill.version = ${project.version}
-krill.name = ${project.name}
-
 # Krill Backend properties
 krill.properties     = true
 krill.indexDir       = [PATH TO INDEX DIRECTORY]
