diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 4b4761f..e6f1a69 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1330,10 +1330,14 @@ new_tab_homepage_get_mapping (GValue   *value,
 static GVariant *
 new_tab_homepage_set_mapping (const GValue       *value,
                               const GVariantType *expected_type,
-                              gpointer            user_data)
+                              PrefsDialog        *dialog)
 {
   if (!g_value_get_boolean (value))
     return NULL;
+
+  gtk_entry_set_text (GTK_ENTRY (dialog->custom_homepage_entry), "");
+  gtk_widget_set_sensitive (dialog->custom_homepage_entry, FALSE);
+
   return g_variant_new_string ("");
 }
 
@@ -1354,10 +1358,13 @@ blank_homepage_get_mapping (GValue   *value,
 static GVariant *
 blank_homepage_set_mapping (const GValue       *value,
                             const GVariantType *expected_type,
-                            gpointer            user_data)
+                            PrefsDialog        *dialog)
 {
   if (!g_value_get_boolean (value))
     return NULL;
+
+  gtk_entry_set_text (GTK_ENTRY (dialog->custom_homepage_entry), "");
+
   return g_variant_new_string ("about:blank");
 }
 
@@ -1371,6 +1378,7 @@ custom_homepage_get_mapping (GValue   *value,
   setting = g_variant_get_string (variant, NULL);
   if (setting && setting[0] != '\0' && g_strcmp0 (setting, "about:blank") != 0)
     g_value_set_boolean (value, TRUE);
+
   return TRUE;
 }
 
@@ -1384,6 +1392,7 @@ custom_homepage_set_mapping (const GValue       *value,
 
   if (!g_value_get_boolean (value)) {
     gtk_widget_set_sensitive (dialog->custom_homepage_entry, FALSE);
+    gtk_entry_set_text (GTK_ENTRY (dialog->custom_homepage_entry), "");
     return NULL;
   }
 
@@ -1394,6 +1403,7 @@ custom_homepage_set_mapping (const GValue       *value,
     return NULL;
 
   gtk_entry_set_text (GTK_ENTRY (dialog->custom_homepage_entry), setting);
+
   return g_variant_new_string (setting);
 }
 
@@ -1401,8 +1411,16 @@ static void
 custom_homepage_entry_changed (GtkEntry    *entry,
                                PrefsDialog *dialog)
 {
-  g_settings_set_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL,
-                         gtk_entry_get_text (entry));
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->custom_homepage_radiobutton)))
+    g_settings_set_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL,
+                           gtk_entry_get_text (entry));
+  else if ((gtk_entry_get_text (entry) != NULL) && gtk_toggle_button_get_active
+            GTK_TOGGLE_BUTTON (dialog->new_tab_homepage_radiobutton)) {
+    g_settings_set_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL,
+                           gtk_entry_get_text (entry));
+    gtk_widget_set_sensitive (dialog->custom_homepage_entry, TRUE);
+    gtk_widget_grab_focus (dialog->custom_homepage_entry);
+  }
 }
 
 static void
@@ -1451,7 +1469,7 @@ setup_general_page (PrefsDialog *dialog)
                                 G_SETTINGS_BIND_DEFAULT,
                                 new_tab_homepage_get_mapping,
                                 new_tab_homepage_set_mapping,
-                                NULL,
+                                dialog,
                                 NULL);
   g_settings_bind_with_mapping (settings,
                                 EPHY_PREFS_HOMEPAGE_URL,
@@ -1460,7 +1478,7 @@ setup_general_page (PrefsDialog *dialog)
                                 G_SETTINGS_BIND_DEFAULT,
                                 blank_homepage_get_mapping,
                                 blank_homepage_set_mapping,
-                                NULL,
+                                dialog,
                                 NULL);
   g_settings_bind_with_mapping (settings,
                                 EPHY_PREFS_HOMEPAGE_URL,
