diff --git a/interface/lib/classes/tools_monitor.inc.php b/interface/lib/classes/tools_monitor.inc.php
index bd1a969d57457fee98709adf390ea4ab12b0e00f..ce3ffca1eba13e81ab2565eb6665fb0e4da31201 100644
--- a/interface/lib/classes/tools_monitor.inc.php
+++ b/interface/lib/classes/tools_monitor.inc.php
@@ -146,7 +146,7 @@ class tools_monitor {
 				$line['client'] = $tmp['username'];
 
 				//* get the domain
-				$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name=?", $line['database_name']);
+				$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name=?)", $line['database_name']);
 				$line['domain'] = $tmp['domain'];
 
 				//* remove the sys_groupid from output
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index ac7f4c6fce708bc69ca256ddb63682e8adba8902..3f63c7ee8cae0bcdc37806ccf6891098810c15e2 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -204,9 +204,12 @@ class page_action extends tform_actions {
 				$reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id);
 				
 				if($reseller['customer_no_template'] != '') {
-					//* Set customer no default
-					$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
-					$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
+					if(isset($this->dataRecord['customer_no'])&& $this->dataRecord['customer_no']!='') $customer_no_string = $this->dataRecord['customer_no'];
+					else {
+						//* Set customer no default
+						$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
+						$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
+					}
 					$app->tpl->setVar('customer_no',$customer_no_string);
 				}
 			}
diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php
index 9064581c17396cd64623157bf83040c2f6403882..67be43e04c829058babcdde95b54928964351d07 100644
--- a/interface/web/client/domain_edit.php
+++ b/interface/web/client/domain_edit.php
@@ -85,10 +85,10 @@ class page_action extends tform_actions {
 			$clients = $app->db->queryAllRecords($sql);
 			$client_select = '';
 			if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
-			$tmp_data_record = $app->tform->getDataRecord($this->id);
+			if($this->id > 0) $tmp_data_record = $app->tform->getDataRecord($this->id); else $tmp_data_record = $this->dataRecord;
 			if(is_array($clients)) {
 				foreach( $clients as $client) {
-					$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
+					$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"] || $client["groupid"] == $tmp_data_record["client_group_id"])?'SELECTED':'';
 					$client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
 				}
 			}