Index: autoassignrole.module
===================================================================
--- autoassignrole.module	(revision 67)
+++ autoassignrole.module	(revision 68)
@@ -665,19 +665,29 @@
  * the replacement registration path.
  */
 function autoassignrole_menu_alter(&$items) {
+  $path = _autoassignrole_get_path();
+	
+  if (isset($path)) {
+    $items['user/register']['page callback'] = '_autoassignrole_register_page';
+  }
+}
+
+function _autoassignrole_get_path() {
   $row = db_fetch_object(db_query("SELECT rid, path, display, title, weight, menu, registration FROM {autoassignrole_page} WHERE registration = 1"));
   if (isset($row->registration)) {
-    $path = $row->path;
+  	$path = $row->path;
   }
   else {
-    $row = db_fetch_object(db_query("SELECT arid, value FROM {autoassignrole} WHERE arid = '%s'", 'node_user_register'));
-    if (!empty($row->value)) {
-      $path = 'node/'. $row->value;
-    }
-  }
-  if (isset($path)) {
-    $items['user/register']['page arguments'] = array($path);
-    $items['user/register']['page callback'] = 'drupal_goto';
-    $items['user/register']['type'] = MENU_LOCAL_TASK;
-  }
+  	$row = db_fetch_object(db_query("SELECT arid, value FROM {autoassignrole} WHERE arid = '%s'", 'node_user_register'));
+	if (!empty($row->value)) {
+	  $path = 'node/'. $row->value;
+	}
+  }	
+  return $path;
 }
+
+function _autoassignrole_register_page() {
+  $path = _autoassignrole_get_path();
+  menu_set_active_item($path);
+  return menu_execute_active_handler();  
+}
