Index: /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 13586)
@@ -36,4 +36,5 @@
 import org.greenstone.gatherer.Gatherer;
 import org.greenstone.gatherer.LocalLibraryServer;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.gui.GLIButton;
 import org.greenstone.gatherer.metadata.MetadataElement;
@@ -484,5 +485,5 @@
 
 	// If we're using the Local Library we must release the collection before writing to the collect.cfg file
-	String collection_name = Gatherer.c_man.getCollection().getName();
+	String collection_name = CollectionManager.getLoadedCollectionName();
 	boolean collection_released = false;
 	if (Gatherer.c_man.built() && LocalLibraryServer.isRunning() == true) {
Index: /trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java	(revision 13586)
@@ -38,4 +38,5 @@
 import org.greenstone.gatherer.Dictionary;
 import org.greenstone.gatherer.Gatherer;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.gui.DesignPaneHeader;
 import org.greenstone.gatherer.gui.EmailField;
@@ -152,5 +153,5 @@
 	    
 	    JLabel short_name_label = new JLabel(Dictionary.get("NewCollectionPrompt.Collection_Name"));
-	    JTextField short_name_textfield = new JTextField(Gatherer.c_man.getCollection().getName());
+	    JTextField short_name_textfield = new JTextField(CollectionManager.getLoadedCollectionName());
 	    short_name_textfield.setEditable(false);
 	    short_name_textfield.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
@@ -317,5 +318,5 @@
 
 	    public BrowseListener(String prefix_raw) {
-		this.prefix = prefix_raw.replaceAll(StaticStrings.COLNAME_PATTERN, Gatherer.c_man.getCollection().getName());
+		this.prefix = prefix_raw.replaceAll(StaticStrings.COLNAME_PATTERN, CollectionManager.getLoadedCollectionName());
 	    }
 
@@ -346,5 +347,5 @@
 			    // If we're using a remote Greenstone server, upload the image
 			    if (Gatherer.isGsdlRemote) {
-				RemoteGreenstoneServer.uploadCollectionFile(Gatherer.c_man.getCollection().getName(), collection_image_file);
+				RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), collection_image_file);
 			    }
 			}
@@ -415,5 +416,5 @@
 		// Set the title
 		String collection_title = name_textfield.getText();
-		String collection_name = Gatherer.c_man.getCollection().getName();
+		String collection_name = CollectionManager.getLoadedCollectionName();
 		Gatherer.g_man.setTitle(collection_title, collection_name);
                 collection_name_collectionmeta.setValue(name_textfield.getText());
Index: /trunk/gli/src/org/greenstone/gatherer/cdm/MacrosManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/MacrosManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/MacrosManager.java	(revision 13586)
@@ -41,9 +41,9 @@
 import java.io.OutputStreamWriter;
 
-import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.Configuration;
 import org.greenstone.gatherer.DebugStream;
 import org.greenstone.gatherer.Dictionary;
 import org.greenstone.gatherer.Gatherer;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.gui.DesignPaneHeader;
 import org.greenstone.gatherer.gui.GLIButton;
@@ -217,6 +217,5 @@
 		// Users need to wait until the upload has finished before pressing Preview Collection!
 		if (Gatherer.isGsdlRemote) {
-		    String collection_name = Gatherer.c_man.getCollection().getName();
-		    RemoteGreenstoneServer.uploadCollectionFile(collection_name, extra_dm_file);
+		    RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), extra_dm_file);
 		}
 	    }
Index: /trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java	(revision 13586)
@@ -36,4 +36,5 @@
 import org.greenstone.gatherer.Gatherer;
 import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.util.CheckList;
 import org.greenstone.gatherer.util.CheckListEntry;
@@ -207,5 +208,5 @@
 	{
 	    collection_checklist_model = new ArrayList();
-	    current_coll_name = Gatherer.c_man.getCollection().getName();
+	    current_coll_name = CollectionManager.getLoadedCollectionName();
 
 	    File collect_directory = new File(Gatherer.getCollectDirectoryPath());
Index: /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 13586)
@@ -562,4 +562,16 @@
     public Collection getCollection() {
 	return collection;
+    }
+
+
+    /** Returns the name of the loaded collection.
+     */
+    static public String getLoadedCollectionName()
+    {
+	if (collection != null) {
+	    return collection.getName();
+	}
+
+	return null;
     }
 
Index: /trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/file/FileManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/file/FileManager.java	(revision 13586)
@@ -41,4 +41,5 @@
 import org.greenstone.gatherer.Dictionary;
 import org.greenstone.gatherer.Gatherer;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.collection.CollectionTree;
 import org.greenstone.gatherer.collection.CollectionTreeNode;
@@ -169,5 +170,5 @@
 		file_queue.addJob(id, source, source_nodes, target, target_node, type);
 		if (Gatherer.isGsdlRemote) {
-		    String collection_name = Gatherer.c_man.getCollection().getName();
+		    String collection_name = CollectionManager.getLoadedCollectionName();
 
 		    // Perform the appropriate action based on the job type (RemoteGreenstoneServer will queue)
@@ -248,5 +249,5 @@
 		// ... but only if it is inside the collection and we haven't already downloaded it
 		if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) {
-		    if (RemoteGreenstoneServer.downloadCollectionFile(Gatherer.c_man.getCollection().getName(), file).equals("")) {
+		    if (RemoteGreenstoneServer.downloadCollectionFile(CollectionManager.getLoadedCollectionName(), file).equals("")) {
 			// Something has gone wrong downloading the file
 			return;
@@ -323,5 +324,5 @@
 			    folder_file.createNewFile();
 			    if (Gatherer.isGsdlRemote) {
-				RemoteGreenstoneServer.uploadCollectionFile(Gatherer.c_man.getCollection().getName(), folder_file);
+				RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), folder_file);
 			    }
 			}
@@ -329,5 +330,5 @@
 			    folder_file.mkdirs();
 			    if (Gatherer.isGsdlRemote) {
-				RemoteGreenstoneServer.newCollectionDirectory(Gatherer.c_man.getCollection().getName(), folder_file);
+				RemoteGreenstoneServer.newCollectionDirectory(CollectionManager.getLoadedCollectionName(), folder_file);
 			    }
 			}
Index: /trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java	(revision 13586)
@@ -48,4 +48,5 @@
 import org.greenstone.gatherer.Gatherer;
 import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.file.WorkspaceTree;  // !!! Don't like this here
 import org.greenstone.gatherer.util.ArrayTools;
@@ -293,5 +294,5 @@
 		Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED);
 
-		if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) {
+		if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(CollectionManager.getLoadedCollectionName())) {
 		    current_coll_deleted = true;
 		}
Index: /trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java	(revision 13586)
@@ -271,5 +271,5 @@
 	else {
 	    // Add in the filename, relative to the collection directory
-	    String collection_name = Gatherer.c_man.getCollection().getName();
+	    String collection_name = CollectionManager.getLoadedCollectionName();
 	    String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection_name);
 	    String metadata_file_relative_path = RemoteGreenstoneServer.getPathRelativeToDirectory(metadata_file, collection_directory_path);
@@ -344,5 +344,5 @@
 		if (Gatherer.isGsdlRemote) {
 		    Utility.delete(metadata_file.getParentFile());
-		    RemoteGreenstoneServer.downloadCollectionFile(Gatherer.c_man.getCollection().getName(), metadata_file.getParentFile());
+		    RemoteGreenstoneServer.downloadCollectionFile(CollectionManager.getLoadedCollectionName(), metadata_file.getParentFile());
 		}
 
Index: /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java	(revision 13585)
+++ /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java	(revision 13586)
@@ -32,4 +32,5 @@
 import org.greenstone.gatherer.DebugStream;
 import org.greenstone.gatherer.Gatherer;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.collection.CollectionTreeNode;
 import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
@@ -377,5 +378,5 @@
 
 	    // Upload the files modified since last time, then reset the list
-	    RemoteGreenstoneServer.uploadCollectionFiles(Gatherer.c_man.getCollection().getName(), (File[]) modified_metadata_xml_files.toArray(new File[0]));
+	    RemoteGreenstoneServer.uploadCollectionFiles(CollectionManager.getLoadedCollectionName(), (File[]) modified_metadata_xml_files.toArray(new File[0]));
 	    modified_metadata_xml_files.clear();
 	}
