Index: trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java
===================================================================
--- trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java	(revision 378)
+++ trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java	(revision 379)
@@ -191,4 +191,5 @@
 	{
 		String pathToOmc = null;
+		File workingDirectory;
 
 		/* 
@@ -213,4 +214,7 @@
 			pathToOmc = omHome + "\\omc.exe";
 		}
+		
+		/* We should start OMC from the OPENMODELICAHOME directory */
+		workingDirectory = new File(omHome);
 
 		/* 
@@ -230,5 +234,5 @@
 		{
 			logOMCStatus("Running command " + command[0] + " " + command[1]);
-			Runtime.getRuntime().exec(command);
+			Runtime.getRuntime().exec(command, null, workingDirectory);
 			logOMCStatus("Command run successfully.");
 		}
@@ -247,9 +251,9 @@
 				if(os.equals("Unix"))
 				{
-					secondaryPathToOmc = omHome + "/Compiler/omc";
+					secondaryPathToOmc = omHome + "/build/bin/omc";
 				}
 				else if(os.equals("Windows"))
 				{
-					secondaryPathToOmc = omHome + "\\Compiler\\omc.exe";
+					secondaryPathToOmc = omHome + "\\build\\bin\\omc.exe";
 				}
 
@@ -258,5 +262,5 @@
 				logOMCStatus("Running command " 
 						+ command[0] + " " + command[1]);
-				Runtime.getRuntime().exec(command);
+				Runtime.getRuntime().exec(command, null, workingDirectory);
 				logOMCStatus("Command run successfully.");
 			}
@@ -533,9 +537,7 @@
 	 * 
 	 * @param className full class name where to look for packages
-	 * @return an array of subclasses defined (and loaded into OMC)
-	 *  inside the class named className, but don't return packages in this
-	 *  class. The results is returned as Vector of objects but objects
-	 *  are actually String's.
-	 *  
+	 * @return a <code>List</code> of subclasses defined (and loaded into OMC)
+	 * inside the class named className.
+	 * 
 	 * @throws ConnectException 
 	 * @throws UnexpectedReplyException 
@@ -559,5 +561,6 @@
 	 * @return the restriction type of the class or Type.CLASS if 
 	 *         type can't be determined
-	 * @throws ConnectException 
+	 * @throws ConnectException
+	 * @throws UnexpectedReplyException
 	 */
 	public IModelicaClass.Type getRestrictionType(String className)
@@ -597,6 +600,6 @@
 	/**
 	 * Fetches the error string from OMC. This should be called after an "Error"
-	 * is received.
-	 * @return
+	 * is received. (Or whenever the queue of errors should be emptied.)
+	 * @return the <code>String</code> of errors
 	 * @throws ConnectException
 	 */
@@ -605,5 +608,7 @@
 	{
 		String res = sendExpression("getErrorString()");
-		if(res != null)
+		
+		/* Make sure the error string isn't empty */
+		if(res != null && res.length() > 2)
 		{
 			res = res.trim();
@@ -619,6 +624,6 @@
 	 * checked.
 	 * @param file the file we want to load
-	 * @return either returns the classes (and packages) found in the file or
-	 * the error messages from OMC
+	 * @return a <code>ParseResult</code> containing the classes found in the
+	 * file and the error messages from OMC 
 	 * @throws ConnectException 
 	 * @throws UnexpectedReplyException 
@@ -645,5 +650,8 @@
 		{			
 			res.setClassNames(new List());
-			res.setCompileErrors(OMCParser.parseErrorString(errorString));
+			if(errorString.equals("") == false)
+			{
+				res.setCompileErrors(OMCParser.parseErrorString(errorString));
+			}
 		}
 		/*
@@ -668,9 +676,9 @@
 
 	/**
-	 * Gets the location (file, line number and column number) of a Modelica
-	 * element. 
+	 * Gets the location (file, starting and ending line number and column
+	 * number) of a Modelica element. 
 	 * @param className the element we want to get location of
-	 * @return an IElementLocation containing the file, line number and column
-	 * number of the given class 
+	 * @return an <code>ElementLocation</code> containing the file, starting and
+	 * ending line number and column number of the given class 
 	 * @throws ConnectException
 	 * @throws UnexpectedReplyException
@@ -688,5 +696,5 @@
 		{
 			throw new 
-				InvocationError("fetching file position of " + className,
+				InvocationError("Fetching file position of " + className,
 						"getCrefInfo(" + className + ")");
 		}
@@ -694,5 +702,5 @@
 		
 		/*
-		 * The getCrefInfo reply have the following format:
+		 * The getCrefInfo reply has the following format:
 		 * 
 		 * <file path>,<something>,<start line>,<start column>,<end line>,<end column>
@@ -736,5 +744,5 @@
 	 * 
 	 * @param className fully qualified name of the class/package
-	 * @return true if className is a package false otherwise
+	 * @return true if className is a package, false otherwise
 	 * @throws ConnectException 
 	 */
@@ -750,4 +758,12 @@
 	}
 	
+	/**
+	 * Uses the OMC API call getElementsInfo to fetch lots of information
+	 * about a class definition. See interactive_api.txt in the OMC
+	 * source tree.
+	 * @param className the fully qualified name of a class
+	 * @return a <code>Collection</code> (of <code>ElementsInfo</code>)
+	 * containing the information about className
+	 */
 	public Collection<ElementsInfo> getElementsInfo(String className)
 		throws ConnectException, InvocationError, UnexpectedReplyException
@@ -807,5 +823,8 @@
 	}
 
-	
+	/**
+	 * @return the name of the compiler that this plugin tries to communicate
+	 * with (at least it tries...)
+	 */
 	public String getCompilerName()
 	{
