diff --git a/sites/all/modules/uc_cim/uc_cim.module b/sites/all/modules/uc_cim/uc_cim.module
index 5bc59bf..c539198 100644
--- a/sites/all/modules/uc_cim/uc_cim.module
+++ b/sites/all/modules/uc_cim/uc_cim.module
@@ -222,6 +222,7 @@ function uc_cim_order($op, &$arg1, $arg2) {
   switch ($op) {
 
     case 'submit':
+
       if ($arg1->payment_method == 'cim' && variable_get('uc_credit_checkout_process', FALSE)) {
 
         //Handle pre-orders for out of stock items by adjusting the order total, temporarily
@@ -232,6 +233,7 @@ function uc_cim_order($op, &$arg1, $arg2) {
         $arg1->payment_method = 'credit';
         $return = uc_credit_order($op, $arg1, $arg2);
         $arg1->payment_method = 'cim';
+        
 
         //Reset the order total to the real total, so that the order object gets saved correctly
         $arg1->order_total = $real_order_total;
@@ -630,7 +632,6 @@ function uc_cim_charge($order_id, $amount, $data = NULL, $update_cim_order_table
   else {
     $gateway_message = t('Invalid response from gateway.');
   }
-
   //Process the response
   if (!isset($response->directResponse) && isset($response->messages->message->code) && $response->messages->message->code != 'I00001') {
     //If we failed to create a profile, we just have the CIM gateway error message
@@ -640,26 +641,28 @@ function uc_cim_charge($order_id, $amount, $data = NULL, $update_cim_order_table
   elseif ($response->directResponse) {
     //If we processed a transaction, we'll have a directResponse from the bank with the details.
     $directResponse = explode(variable_get('cim_delimiter', ','), $response->directResponse);
+    _uc_cim_dequote($directResponse);
     if (!is_numeric($directResponse[0])) {
       // wrong delimiter.  try the other one and log the problem
       // If this still fails, the response should be handled correctly since
       //   it is cast to an integer, but authorization code will be lost.
-      $delimiter = (variable_get('cim_delimiter', ',') == ',') ? '|' : ',';
+//      $delimiter = (variable_get('cim_delimiter', ',') == ',') ? '|' : ',';
       $directResponse = explode($delimiter, $response->directResponse);
-      watchdog('uc_cim', 'Incorrect delimiter "'. variable_get('cim_delimiter', ',') .'" set for response: '. $response->directResponse .'. Raw CIM response: '. $response->messages->message->text, array(), WATCHDOG_WARNING);
+      watchdog('uc_cim', 'Incorrect delimiter "'. variable_get('cim_delimiter', ',') .'" set for direct response: '. $response->directResponse .'. Raw CIM response: '. $response->messages->message->text.print_r($directResponse,1), array(), WATCHDOG_WARNING);
     }
     $bank_message = $directResponse[3];
   }
   elseif ($response->validationDirectResponse) {
     //If we failed to process the transaction but did perform a validation during payment profile creation, we'll have a validationDirectResponse with the details. Note that the respose for validate_customer_payment_profile_request is in directResonse. Go figure. That's ok, though, it's handled above.
     $directResponse = explode(variable_get('cim_delimiter', ','), $response->validationDirectResponse);
+    _uc_cim_dequote($directResponse);
     if (!is_numeric($directResponse[0])) {
       // wrong delimiter.  try the other one and log the problem
       // If this still fails, the response should be handled correctly since
       //   it is cast to an integer, but authorization code will be lost.
       $delimiter = (variable_get('cim_delimiter', ',') == ',') ? '|' : ',';
-      $directResponse = explode($delimiter, $response->validationDirectResponse);
-      watchdog('uc_cim', 'Incorrect delimiter "'. variable_get('cim_delimiter', ',') .'" set for response: '. $response->directResponse .'. Raw CIM response: '. $response->messages->message->text, array(), WATCHDOG_WARNING);
+//      $directResponse = explode($delimiter, $response->validationDirectResponse);
+      watchdog('uc_cim', 'Incorrect delimiter "'. variable_get('cim_delimiter', ',') .'" set for validationresponse: '.$directResponse[0].':'. $response->validationDirectResponse .'. Raw CIM response: '. $response->messages->message->text, array(), WATCHDOG_WARNING);
     }
     $bank_message = $directResponse[3];
   }
@@ -735,6 +738,13 @@ function uc_cim_charge($order_id, $amount, $data = NULL, $update_cim_order_table
   return $result;
 }
 
+
+function _uc_cim_dequote(&$arry) {
+  foreach ($arry as $k=>$v) {
+    $arry[$k] = trim($v,'"');
+  }
+}
+
 /**
  * @todo This function should utilize callback arguments from the D6 menu system instead of checking arg()
  */
@@ -895,6 +905,7 @@ function uc_cim_credit_card_form($user_id, $order, $address_book_path = 'panes-c
   //MERGE ALL
   if ($existing_cards_form) {
     $form = array_merge($existing_cards_form, $credit_form, $address_form);
+    
   }
   else {
     $form = array_merge($credit_form, $address_form);
@@ -1981,7 +1992,9 @@ function update_customer_payment_profile_request($profile_id, $order, $payment_p
 }
 
 function create_customer_profile_transaction_request($profile_id, $payment_profile_id, $order, $amount) {
-
+  // Fix for error response saying amount such as "55.12345" is invalid according to it's datatype of Decimal
+  $amount = number_format($amount, 2);
+  $amount = str_replace(',', '', $amount);
   //Build the order description
   $description = '';
   if (is_array($order->products)) {
@@ -2229,6 +2242,10 @@ function uc_cim_refund($order_id, $transaction_id, $last_four, $amount, $type =
  * Helper Functions
  * *****************************************************************************/
 function uc_cim_save_profile_id($user_id, $profile_id) {
+  // Don't allow anonymous users to save credit card info!
+  if ($user_id == 0) {
+    return;
+  }
   //The table to update depends on test mode or production mode - get the right one
   $table = uc_cim_table('uc_cim');
 
@@ -2256,6 +2273,7 @@ function uc_cim_save_payment_profile($profile_id, $payment_profile_id, $last_fou
 }
 
 function uc_cim_get_profile_id($user_id) {
+  
   //The table to get from depends on test mode or production mode - get the right one
   $table = uc_cim_table('uc_cim');
 
@@ -2263,6 +2281,7 @@ function uc_cim_get_profile_id($user_id) {
   $sql = "SELECT customer_profile_id FROM {". $table ."} WHERE uid = %d";
   $result = db_query($sql, $user_id);
   $profile_id = db_result($result);
+
   return $profile_id;
 }
 
@@ -2729,4 +2748,4 @@ function uc_cim_token_list($type = 'all') {
     $tokens['uc_cim_payment_profile']['payment-profile-edit-link'] = t('Link to edit billing info.');
     return $tokens;
   }
-}
\ No newline at end of file
+}
