--- uc_fedex.module.orig	2010-03-07 12:47:45.000000000 -0800
+++ uc_fedex.module	2010-03-07 12:51:41.000000000 -0800
@@ -435,15 +435,25 @@ function uc_fedex_quote($products, $deta
     if (in_array($service, $fedex_services)) {
       // Check to see if we're quoting ACCOUNT or LIST rates
       if (variable_get('uc_fedex_quote_type', 'list') == 'list') {  // LIST rate
-        // LIST quotes return both ACCOUNT rates (in RatedShipmentDetails[0])
-        // and LIST rates (in RatedShipmentDetails[1])
-        $ratedetail = $options->RatedShipmentDetails[1];
+        // LIST quotes return both ACCOUNT rates (in RatedShipmentDetails[1])
+        // and LIST rates (in RatedShipmentDetails[3])
+        //$ratedetail = $options->RatedShipmentDetails[3];
+        foreach($options->RatedShipmentDetails as $ratedetail){
+          if($ratedetail->ShipmentRateDetail->RateType == 'RATED_LIST'){
+            break;
+          }
+        }
       }
       else {  // ACCOUNT rate
         // ACCOUNT quotes may return either ACCOUNT rates only OR
         // ACCOUNT rates and LIST rates.  Check.
         if (is_array($options->RatedShipmentDetails)) {
-          $ratedetail = $options->RatedShipmentDetails[0];
+          //$ratedetail = $options->RatedShipmentDetails[1];
+            foreach($options->RatedShipmentDetails as $ratedetail){
+              if($ratedetail->ShipmentRateDetail->RateType == 'RATED_ACCOUNT'){
+                break;
+              }
+            }
         }
         else {
           $ratedetail = $options->RatedShipmentDetails;
