diff --git a/admin/judges.inc.php b/admin/judges.inc.php
index f194ebad..a8866c10 100644
--- a/admin/judges.inc.php
+++ b/admin/judges.inc.php
@@ -48,7 +48,7 @@ function getJudgingTeams()
 		
 		while($mr=mysql_fetch_object($mq))
 		{
-			$u = user_load($mr->judges_id, true);
+			$u = user_load($mr->judges_id, false);
 			$judgelangs = join('/', $u['languages']);
 			
 			$teams[$lastteamid]['members'][]=array(
diff --git a/admin/user_editor_window.php b/admin/user_editor_window.php
index 0e4578b8..477ec3af 100644
--- a/admin/user_editor_window.php
+++ b/admin/user_editor_window.php
@@ -78,11 +78,15 @@ if(array_key_exists('username',$_GET)) {
 	$username = $_GET['username'];
 	$type = $_GET['type'];
 	$un = mysql_escape_string($username);
-	$q = mysql_query("SELECT id,MAX(year),deleted FROM users WHERE username='$un'");
-	$r = mysql_fetch_object($q);
-	if($r->deleted == 'no') {
-		echo "Username already exists.";
-		exit;
+	$q = mysql_query("SELECT id,MAX(year),deleted FROM users WHERE username='$un' GROUP BY uid");
+echo mysql_error();
+
+	if(mysql_num_rows($q)) {
+		$r = mysql_fetch_object($q);
+		if($r->deleted == 'no') {
+			echo "Username already exists.";
+			exit;
+		}
 	}
 	$u = user_create($type, $username);
 	$u['email'] = $username;