diff --git a/compiler/src/org/apache/flex/utils/ArgumentUtil.java b/compiler/src/org/apache/flex/utils/ArgumentUtil.java
index 8b5fe7a..6987cba 100644
--- a/compiler/src/org/apache/flex/utils/ArgumentUtil.java
+++ b/compiler/src/org/apache/flex/utils/ArgumentUtil.java
@@ -53,14 +53,15 @@
             }
         }
 
-        if (index < 0 || index >= length) {
-            throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + length);
-        }
+        String[] newArgs = new String[length - 1];
 
-        String[] newArgs = new String[args.length - 1];
-        System.arraycopy(args, 0, newArgs, 0, index);
-        if (index < length - 1) {
-            System.arraycopy(args, index + 1, newArgs, index, length - index - 1);
+        if (index < 0 || index >= length) {
+            System.arraycopy(args, 0, newArgs, 0, length - 1);
+        } else  {
+            System.arraycopy(args, 0, newArgs, 0, index);
+            if (index < length - 1) {
+                System.arraycopy(args, index + 1, newArgs, index, length - index - 1);
+            }
         }
 
         return newArgs;
diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
index a41c1f4..b77dd8f 100644
--- a/flex-compiler-oem/src/flex2/tools/Tool.java
+++ b/flex-compiler-oem/src/flex2/tools/Tool.java
@@ -31,6 +31,11 @@
 import org.apache.flex.compiler.clients.MXMLJSC.JSOutputType;
 import org.apache.flex.compiler.clients.problems.ProblemQuery;
 import org.apache.flex.compiler.clients.problems.ProblemQueryProvider;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.ConfigurationBuffer;
+import org.apache.flex.compiler.config.ConfigurationValue;
+import org.apache.flex.compiler.filespecs.FileSpecification;
+import org.apache.flex.compiler.internal.config.FileConfigurator;
 import org.apache.flex.compiler.problems.CompilerProblemSeverity;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.problems.annotations.DefaultSeverity;
@@ -41,10 +46,7 @@
 import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationTargetException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
 
 import static org.apache.flex.compiler.clients.MXMLJSC.JSOutputType.FLEXJS_DUAL;
 
@@ -81,26 +83,36 @@
         return exitCode;
     }
 
-    protected static class ArgumentBag {
-        public String[] args;
-
-        public String oldOutputPath;
-        public String newOutputPath;
-
-        public ArgumentBag(String[] args) {
-            this.args = args;
-        }
-    }
-
     protected static ArgumentBag preparePhase1(ArgumentBag bag) {
+        bag.isCommandLineOutput = true;
+
         bag.oldOutputPath = ArgumentUtil.getValue(bag.args, "-output");
 
+        if (bag.oldOutputPath == null) {
+            bag.isCommandLineOutput = false;
+            ConfigurationBuffer flexConfig = null;
+
+            try {
+                flexConfig = loadConfig(bag.args);
+            } catch (org.apache.flex.compiler.exceptions.ConfigurationException ignored) {
+            }
+
+            final List<ConfigurationValue> output = flexConfig != null ? flexConfig.getVar("output") : null;
+            final ConfigurationValue configurationValue = output != null ? output.get(0) : null;
+            bag.oldOutputPath = configurationValue != null ? configurationValue.getArgs().get(0) : null;
+        }
+
         if (bag.oldOutputPath != null) {
             final int lastIndexOf = Math.max(bag.oldOutputPath.lastIndexOf("/"), bag.oldOutputPath.lastIndexOf("\\"));
 
             if (lastIndexOf > -1) {
                 bag.newOutputPath = bag.oldOutputPath.substring(0, lastIndexOf) + File.separator + "js" + File.separator + "out";
-                ArgumentUtil.setValue(bag.args, "-output", bag.newOutputPath);
+
+                if (bag.isCommandLineOutput) {
+                    ArgumentUtil.setValue(bag.args, "-output", bag.newOutputPath);
+                } else {
+                    bag.args = ArgumentUtil.addValueAt(bag.args, "-output", bag.newOutputPath, bag.args.length - 1);
+                }
             }
         }
 
@@ -111,7 +123,11 @@
         bag.args = ArgumentUtil.removeElement(bag.args, "-js-output-type");
 
         if (bag.oldOutputPath != null) {
-            ArgumentUtil.setValue(bag.args, "-output", bag.oldOutputPath);
+            if (bag.isCommandLineOutput) {
+                ArgumentUtil.setValue(bag.args, "-output", bag.oldOutputPath);
+            } else {
+                bag.args = ArgumentUtil.removeElement(bag.args, "-output");
+            }
         }
 
         if (COMPILER.getName().equals(COMPC.class.getName())) {
@@ -121,6 +137,28 @@
         return bag;
     }
 
+    private static ConfigurationBuffer loadConfig(String[] args) throws org.apache.flex.compiler.exceptions.ConfigurationException {
+        final String configFilePath = ArgumentUtil.getValue(args, "-load-config");
+        final File configFile = new File(configFilePath);
+        final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
+        final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
+
+        FileConfigurator.load(
+                cfgbuf,
+                fileSpecification,
+                new File(configFile.getPath()).getParent(),
+                "flex-config",
+                false);
+
+        return cfgbuf;
+    }
+
+    private static ConfigurationBuffer createConfigurationBuffer(
+            Class<? extends Configuration> configurationClass) {
+        return new ConfigurationBuffer(
+                configurationClass, Configuration.getAliases());
+    }
+
     protected static int flexCompile(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
         int exitCode;
 
@@ -263,4 +301,16 @@
             return mxmlc.getProblems();
         }
     }
+
+    protected static class ArgumentBag {
+        public String[] args;
+
+        public String oldOutputPath;
+        public String newOutputPath;
+        public boolean isCommandLineOutput;
+
+        public ArgumentBag(String[] args) {
+            this.args = args;
+        }
+    }
 }
