diff --git a/profile2_regpath.module b/profile2_regpath.module
index e26d7df..989eeb9 100755
--- a/profile2_regpath.module
+++ b/profile2_regpath.module
@@ -176,9 +176,18 @@ function profile2_regpath_form_alter(&$form, &$form_state, $form_id) {
         $path = $source;
       }
 
-      // Grab first part of URL.
+      // Get an indexed array of all url's segments.
       $path_parts = explode('/', $path);
-      $path_key = reset($path_parts);
+      // Find the position of the "register" segment.
+      $register_string_index = array_search('register', $path_parts);
+      if ($register_string_index === FALSE) {
+        // Just in case... (Normally this should not happen)
+        return;
+      }
+      // The url segment for this profile should be one position before the
+      // "register" segment.
+      $path_key_index = intval($register_string_index) - 1;
+      $path_key = $path_parts[$path_key_index];
 
       // Load profiles for this path key.
       $profile_types = profile2_regpath_regpath_load_multiple(array('path' => $path_key, 'status' => 1));
