diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php
index c7a7bcdeaf845d05631774a1370d9c4092dd5238..31bdd125675445f1c173b5cb14bebb1d4224fff7 100644
--- a/apps/contacts/ajax/editname.php
+++ b/apps/contacts/ajax/editname.php
@@ -17,13 +17,10 @@ function bailOut($msg) {
 function debug($msg) {
 	OC_Log::write('contacts','ajax/editname.php: '.$msg, OC_Log::DEBUG);
 }
-foreach ($_GET as $key=>$element) {
-	debug('_GET: '.$key.'=>'.$element);
-}
 
 $tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog");
 
-$id = $_GET['id'];
+$id = isset($_GET['id'])?$_GET['id']:'';
 if($id) {
 	$vcard = OC_Contacts_App::getContactVCard($id);
 	$name = array('', '', '', '', '');
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index bd01e38554351109697d54113223a8167c91b492..34210a4567cc4308e4082bc79621195b344a65d3 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -363,8 +363,6 @@ Contacts={
 				//Contacts.UI.notImplemented();
 				//return false;
 				this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = '';
-
-				
 				$.getJSON('ajax/newcontact.php',{},function(jsondata){
 					if(jsondata.status == 'success'){
 						id = '';
@@ -379,6 +377,7 @@ Contacts={
 				});
 			},
 			add:function(n, fn, aid){ // add a new contact
+				console.log('Add contact: ' + n + ', ' + fn + ' ' + aid);
 				$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid },
 				  function(jsondata) {
 					if (jsondata.status == 'success'){
@@ -554,6 +553,7 @@ Contacts={
 			},
 			editName:function(){
 				var isnew = (this.id == '');
+				/* Initialize the name edit dialog */
 				if($('#edit_name_dialog').dialog('isOpen') == true){
 					$('#edit_name_dialog').dialog('moveToTop');
 				}else{ // TODO: If id=='' call addcontact.php (or whatever name) instead and reload view with id.
@@ -1035,18 +1035,6 @@ $(document).ready(function(){
 	 */
 	$('#contacts_newcontact').click(function(){
 		Contacts.UI.Card.editNew();
-// 		$.getJSON('ajax/addcontact.php',{},function(jsondata){
-// 			if(jsondata.status == 'success'){
-// 				$('#rightcontent').data('id','');
-// 				$('#rightcontent').html(jsondata.data.page)
-// 					.find('select').chosen();
-// 			}
-// 			else{
-// 				Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
-// 				//alert(jsondata.data.message);
-// 			}
-// 		});
-// 		return false;
 	});
 	
 	/**
@@ -1071,7 +1059,7 @@ $(document).ready(function(){
 	});
 
 	/**
-	 * Delete currently selected contact and TODO: clear page
+	 * Delete currently selected contact TODO: and clear page
 	 */
 	$('#contacts_deletecard').live('click',function(){
 		Contacts.UI.Card.delete();