diff --git a/plugins/content_types/pm_existing_pages.inc b/plugins/content_types/pm_existing_pages.inc
index 9e3aef0..707d630 100644
--- a/plugins/content_types/pm_existing_pages.inc
+++ b/plugins/content_types/pm_existing_pages.inc
@@ -29,16 +29,9 @@ function pm_existing_pages_pm_existing_pages_content_type_render($subtype, $conf
     return;
   }
 
-  $menu_item = menu_get_item();
-  if (!empty($menu_item['page_arguments'])) {
-    $args = $menu_item['page_arguments'];
-  }
-
-  if (empty($args)) {
-    return;
-  }
+  $args = $panel_args[1];
+  $pm_args = $panel_args[2];
 
-  $pm_args = array_pop($args);
   $function = $pm_args['pc'];
   $file = $pm_args['f'];
   $file_path = $pm_args['fp'];
diff --git a/plugins/tasks/pm_existing_pages.inc b/plugins/tasks/pm_existing_pages.inc
index 629a8c7..a8ced9a 100644
--- a/plugins/tasks/pm_existing_pages.inc
+++ b/plugins/tasks/pm_existing_pages.inc
@@ -88,7 +88,12 @@ function pm_existing_pages_pm_existing_pages_menu_alter(&$items, $task) {
 function pm_existing_pages_pm_existing_pages_page() {
   $args = func_get_args();
 
-  $pm_args = array_pop($args);
+  // Determine which are the menu and pmep arguments.
+  $split_args = _pm_existing_pages_get_pm_args($args);
+  $menu_args = $split_args['menu'];
+
+  // Get pmep arguments.
+  $pm_args = $split_args['pmep'];
   $task_id = $pm_args['ti'];
   $function = $pm_args['pc'];
   $file = $pm_args['f'];
@@ -104,7 +109,7 @@ function pm_existing_pages_pm_existing_pages_page() {
   ctools_include('context-task-handler');
   $context_args = _pm_existing_pages_get_context_arguments($args, $pm_args, $task_id);
   $contexts = ctools_context_handler_get_task_contexts($task, $subtask, array($context_args[0]));
-  $output = ctools_context_handler_render($task, $subtask, $contexts, array($context_args[1]));
+  $output = ctools_context_handler_render($task, $subtask, $contexts, array($context_args[1], $menu_args, $pm_args));
   if ($output !== FALSE) {
     return $output;
   }
@@ -267,3 +272,31 @@ function _pm_existing_pages_get_context_arguments($menu_args, $pm_args, $task_id
   // Nothing found.
   return array(0 => '', 1 => '');
 }
+
+/**
+ * Helper function to split menu arguments from pm arguments.
+ *
+ * We don't know if there will be any additional arguments
+ * send along through the URL which are not menu loader
+ * arguments or unknown in the menu router path. So
+ * depending on the path, the array we need for pmep
+ * can be the first or last.
+ *
+ * @param $args
+ *   A collection of arguments.
+ */
+function _pm_existing_pages_get_pm_args($args) {
+
+  $arguments = array('menu' => array(), 'pmep' => array());
+
+  foreach ($args as $key => $value) {
+    if (is_array($value) && isset($value['ti'])) {
+      $arguments['pmep'] = $args[$key];
+    }
+    else {
+      $arguments['menu'][] = $value;
+    }
+  }
+
+  return $arguments;
+}
