Index: /trunk/web/addons/job_monarch/image.php
===================================================================
--- /trunk/web/addons/job_monarch/image.php	(revision 299)
+++ /trunk/web/addons/job_monarch/image.php	(revision 300)
@@ -59,22 +59,25 @@
 
 	$ic = new ClusterImage( $clustername );
-	foreach( $filter as $filtername=>$filtervalue ) {
-		//printf("filter %s,%s\n", $filtername, $filtervalue);
-		switch( $filtername ) {
 
-			case "id":
-				$ic->setFilter( 'jobid', $filtervalue );
-				break;
-			case "user":
-				$ic->setFilter( 'owner', $filtervalue);
-				break;
-			case "queue":
-				$ic->setFilter( 'queue', $filtervalue);
-				break;
-			case "state":
-				$ic->setFilter( 'status', $filtervalue);
-				break;
-			default:
-				break;
+	if( isset( $filter ) ) {
+		foreach( $filter as $filtername=>$filtervalue ) {
+			//printf("filter %s,%s\n", $filtername, $filtervalue);
+			switch( $filtername ) {
+
+				case "id":
+					$ic->setFilter( 'jobid', $filtervalue );
+					break;
+				case "user":
+					$ic->setFilter( 'owner', $filtervalue);
+					break;
+				case "queue":
+					$ic->setFilter( 'queue', $filtervalue);
+					break;
+				case "state":
+					$ic->setFilter( 'status', $filtervalue);
+					break;
+				default:
+					break;
+			}
 		}
 	}
Index: /trunk/web/addons/job_monarch/index.php
===================================================================
--- /trunk/web/addons/job_monarch/index.php	(revision 299)
+++ /trunk/web/addons/job_monarch/index.php	(revision 300)
@@ -57,20 +57,23 @@
 
 // Fill filter array in order they were picked by user
-foreach( $myfilter_fields as $myfilter ) {
-
-	switch( $myfilter ) {
-
-		case "queue":
-			$filter[queue]=$queue;
-			break;
-		case "state":
-			$filter[state]=$state;
-			break;
-		case "user":
-			$filter[user]=$user;
-			break;
-		case "id":
-			$filter[id]=$id;
-			break;
+if( isset($myfilter_fields) ) {
+
+	foreach( $myfilter_fields as $myfilter ) {
+
+		switch( $myfilter ) {
+
+			case "queue":
+				$filter[queue]=$queue;
+				break;
+			case "state":
+				$filter[state]=$state;
+				break;
+			case "user":
+				$filter[user]=$user;
+				break;
+			case "id":
+				$filter[id]=$id;
+				break;
+		}
 	}
 }
Index: /trunk/web/addons/job_monarch/libtoga.php
===================================================================
--- /trunk/web/addons/job_monarch/libtoga.php	(revision 299)
+++ /trunk/web/addons/job_monarch/libtoga.php	(revision 300)
@@ -615,4 +615,6 @@
 							$mynodes = explode( ';', $togavalue );
 
+							//print_r($mynodes);
+
 							foreach( $mynodes as $node ) {
 
@@ -636,31 +638,34 @@
 			
 					$nr_nodes = count( $jobs[$jobid][nodes] );
-			
-					foreach( $jobs[$jobid][nodes] as $node ) {
-
-						$domain = $jobs[$jobid][domain];
-		                                $domain_len = 0 - strlen( $domain );
-
-						if( substr( $node, $domain_len ) != $domain ) {
-							$host = $node. '.'.$domain;
-						} else {
-							$host = $node;
+		
+					if( $jobs[$jobid][status] == 'R' ) {
+
+						foreach( $jobs[$jobid][nodes] as $node ) {
+
+							$domain = $jobs[$jobid][domain];
+							$domain_len = 0 - strlen( $domain );
+
+							if( substr( $node, $domain_len ) != $domain ) {
+								$host = $node. '.'.$domain;
+							} else {
+								$host = $node;
+							}
+
+							//$host = $node.'.'.$jobs[$jobid][domain];
+				
+							if( !isset( $nodes[$host] ) )
+								$my_node = new NodeImage( $host );
+							else
+								$my_node = $nodes[$host];
+
+							if( !$my_node->hasJob( $jobid ) )
+
+								if( isset( $jobs[$jobid][ppn] ) )
+									$my_node->addJob( $jobid, ((int) $jobs[$jobid][ppn]) );
+								else
+									$my_node->addJob( $jobid, 1 );
+
+							$nodes[$host] = $my_node;
 						}
-
-						//$host = $node.'.'.$jobs[$jobid][domain];
-				
-						if( !isset( $nodes[$host] ) )
-							$my_node = new NodeImage( $host );
-						else
-							$my_node = $nodes[$host];
-
-						if( !$my_node->hasJob( $jobid ) )
-
-							if( isset( $jobs[$jobid][ppn] ) )
-								$my_node->addJob( $jobid, ((int) $jobs[$jobid][ppn]) );
-							else
-								$my_node->addJob( $jobid, 1 );
-
-						$nodes[$host] = $my_node;
 					}
 				}
Index: /trunk/web/addons/job_monarch/overview.php
===================================================================
--- /trunk/web/addons/job_monarch/overview.php	(revision 299)
+++ /trunk/web/addons/job_monarch/overview.php	(revision 300)
@@ -540,6 +540,9 @@
 			$display_job = 1;
 
-			foreach( $jobs[$jobid][nodes] as $tempnode )
-				$all_used_nodes[] = $tempnode;
+			if( $jobs[$jobid][status] == 'R' ) {
+				foreach( $jobs[$jobid][nodes] as $tempnode ) {
+					$all_used_nodes[] = $tempnode;
+				}
+			}
 
 			$used_cpus += $cpus;
