Index: applet/agent.c
===================================================================
--- applet/agent.c	(revision 558)
+++ applet/agent.c	(working copy)
@@ -556,8 +556,8 @@
 	DBusGProxy *adapter = user_data;
 	GHashTable *hash = NULL;
 	GValue *value;
-	const gchar *address, *alias;
-	gchar *name, *line;
+	const gchar *address;
+	gchar *name, *line, *alias;
 
 	device_get_properties(device, &hash, NULL);
 
@@ -566,7 +566,8 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Name");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
 	} else {
 		address = NULL;
 		alias = NULL;
@@ -593,6 +594,7 @@
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
+	g_free(alias);
 
 	return TRUE;
 }
@@ -603,8 +605,8 @@
 	DBusGProxy *adapter = user_data;
 	GHashTable *hash = NULL;
 	GValue *value;
-	const gchar *address, *alias;
-	gchar *name, *line;
+	const gchar *address;
+	gchar *name, *line, *alias;
 
 	device_get_properties(device, &hash, NULL);
 
@@ -613,7 +615,9 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Name");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
+
 	} else {
 		address = NULL;
 		alias = NULL;
@@ -640,6 +644,7 @@
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
+	g_free(alias);
 
 	return TRUE;
 }
@@ -651,8 +656,8 @@
 	DBusGProxy *adapter = user_data;
 	GHashTable *hash = NULL;
 	GValue *value;
-	const gchar *address, *alias;
-	gchar *name, *line, *text;
+	const gchar *address;
+	gchar *name, *line, *text, *alias;
 
 	device_get_properties(device, &hash, NULL);
 
@@ -661,7 +666,9 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Name");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
+
 	} else {
 		address = NULL;
 		alias = NULL;
@@ -690,6 +697,7 @@
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
+	g_free(alias);
 
 	return TRUE;
 }
@@ -700,8 +708,8 @@
 	DBusGProxy *adapter = user_data;
 	GHashTable *hash = NULL;
 	GValue *value;
-	const gchar *address, *alias;
-	gchar *name, *line, *text;
+	const gchar *address;
+	gchar *name, *line, *text, *alias;
 
 	device_get_properties(device, &hash, NULL);
 
@@ -710,7 +718,9 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Name");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
+
 	} else {
 		address = NULL;
 		alias = NULL;
@@ -739,6 +749,7 @@
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
+	g_free(alias);
 
 	return TRUE;
 }
@@ -749,8 +760,8 @@
 	DBusGProxy *adapter = user_data;
 	GHashTable *hash = NULL;
 	GValue *value;
-	const gchar *address, *alias;
-	gchar *name, *line;
+	const gchar *address;
+	gchar *name, *line, *alias;
 
 	device_get_properties(device, &hash, NULL);
 
@@ -759,7 +770,8 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Name");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
 	} else {
 		address = NULL;
 		alias = NULL;
@@ -784,6 +796,7 @@
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
+	g_free(alias);
 
 	return TRUE;
 }
Index: common/bluetooth-client.c
===================================================================
--- common/bluetooth-client.c	(revision 558)
+++ common/bluetooth-client.c	(working copy)
@@ -93,6 +93,60 @@
 
 G_DEFINE_TYPE(BluetoothClient, bluetooth_client, G_TYPE_OBJECT)
 
+
+/**
+ * Remove all leading and trailing spaces from the alias string, as well
+ * as any double spacing characters.
+ */
+void clean_alias_string(gchar *src)
+{
+	gchar last_char = 0;
+	gchar * dst;
+	
+	if(src == NULL){
+		return;
+	}
+	
+	dst = src;
+
+	/* remove leading spaces and any non printable chars */
+	while(g_ascii_isspace(*src) || !g_ascii_isprint(*src)){
+		src++;
+	}
+	
+	last_char = *src;
+	while(*src){
+
+		if(!g_ascii_isprint(*src)){
+			/* skip non printable characters */
+			src++;
+		}else{
+			
+			if(g_ascii_isspace(*src)){
+				if(last_char == *src){
+					src++;
+					continue;
+				}
+			}
+			
+			last_char = *dst = *src;
+			dst++;
+			src++;
+		}
+	}
+
+	if(g_ascii_isspace(last_char)){
+		dst--;	
+	}
+	
+	/* zero out the rest of the string */
+	while(*dst){
+		*dst = '\0';
+		dst++;
+	}
+}
+
+
 const gchar *bluetooth_type_to_string(guint type)
 {
 	switch (type) {
@@ -394,6 +448,7 @@
 	BluetoothClient *client = BLUETOOTH_CLIENT(user_data);
 	BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client);
 	GtkTreeIter iter;
+	gchar *alias;
 
 	DBG("client %p property %s", client, property);
 
@@ -402,14 +457,16 @@
 
 	if (g_str_equal(property, "Name") == TRUE) {
 		const gchar *name = g_value_get_string(value);
-
 		gtk_tree_store_set(priv->store, &iter,
 					BLUETOOTH_COLUMN_NAME, name, -1);
 	} else if (g_str_equal(property, "Alias") == TRUE) {
-		const gchar *alias = g_value_get_string(value);
-
+		alias = g_value_dup_string(value);		
+		clean_alias_string(alias);
+		
 		gtk_tree_store_set(priv->store, &iter,
 					BLUETOOTH_COLUMN_ALIAS, alias, -1);
+		g_free(alias);
+
 	} else if (g_str_equal(property, "Icon") == TRUE) {
 		const gchar *icon = g_value_get_string(value);
 
@@ -446,7 +503,8 @@
 	BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client);
 	DBusGProxy *device;
 	GValue *value;
-	const gchar *address, *alias, *name, *icon;
+	const gchar *address, *name, *icon;
+	gchar *alias;
 	GHashTable *services;
 	gboolean paired, trusted, connected;
 	guint type;
@@ -468,7 +526,8 @@
 		address = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Alias");
-		alias = value ? g_value_get_string(value) : NULL;
+		alias = value ? g_value_dup_string(value) : NULL;		
+		clean_alias_string(alias);
 
 		value = g_hash_table_lookup(hash, "Name");
 		name = value ? g_value_get_string(value) : NULL;
@@ -564,6 +623,10 @@
 				G_CALLBACK(device_changed), client, NULL);
 		g_object_unref(device);
 	}
+
+	if(alias != NULL){
+		g_free(alias);	
+	}
 }
 
 static void device_found(DBusGProxy *adapter, const char *address,
Index: common/bluetooth-client.h
===================================================================
--- common/bluetooth-client.h	(revision 558)
+++ common/bluetooth-client.h	(working copy)
@@ -115,6 +115,8 @@
 const gchar *bluetooth_type_to_string(guint type);
 gboolean bluetooth_verify_address (const char *bdaddr);
 
+void clean_alias_string(gchar *src);
+
 G_END_DECLS
 
 #endif /* __BLUETOOTH_CLIENT_H */
Index: wizard/main.c
===================================================================
--- wizard/main.c	(revision 558)
+++ wizard/main.c	(working copy)
@@ -276,6 +276,8 @@
 			      "device-selected-type", &type,
 			      NULL);
 
+		clean_alias_string(name);
+
 		g_free(target_address);
 		target_address = address;
 
