diff --git a/commerce_paybox.module b/commerce_paybox.module
index fa0ca90..4250e75 100644
--- a/commerce_paybox.module
+++ b/commerce_paybox.module
@@ -229,9 +229,9 @@ function commerce_paybox_offsite_redirect_form($form, &$form_state, $order, $pay
   // Allow other modules to alter Paybox CGI module parameters.
   drupal_alter('commerce_paybox_offsite_params', $pbx_params, $order, $settings);
 
-  // If no hmac key, use cgi module.
-  $hmac_key = variable_get('commerce_paybox_hmac_key', '');
-  if ($hmac_key == '') {
+  // If no HMAC key, use CGI module.
+  $hmac_key = variable_get('commerce_paybox_hmac_key');
+  if (!$hmac_key) {
     // Paybox mode and output must not be altered. Mode 4 is "command line"
     // mode, output D is "output only PXB_DATA".
     $pbx_params['PBX_MODE'] = 4;
@@ -272,11 +272,8 @@ function commerce_paybox_offsite_redirect_form($form, &$form_state, $order, $pay
     }
   }
   else {
-    // Here it is the 'HMAC case'.
     $pbx_params['PBX_HASH'] = variable_get('commerce_paybox_hmac_alg', 'SHA512');
-    // ISO-8601 datetime.
-    $datetime = date("c");
-    $pbx_params['PBX_TIME'] = $datetime;
+    $pbx_params['PBX_TIME'] = date('c');
 
     $form['#pre_render'][] = 'commerce_paybox_hmac_clean_form';
 
@@ -284,18 +281,18 @@ function commerce_paybox_offsite_redirect_form($form, &$form_state, $order, $pay
     $form['#token'] = FALSE;
 
     // Build of the string to hash matching POST's content
-    // used to generate PBX_HASH (except PBX_HASH of course).
+    // used to generate PBX_HMAC.
     $msg = '';
     foreach ($pbx_params as $k => $v) {
       $msg .= $k . "=" . $v . "&";
     }
     $msg = rtrim($msg, '&');
 
-    // Code as paybox's example to generate HMAC key.
+    // Code as Paybox's example to generate PBX_HMAC key.
     $binkey = pack("H*", $hmac_key);
-    $hash = strtolower($pbx_params['PBX_HASH']);
-    $hmac = strtoupper(hash_hmac($hash, $msg, $binkey));
-    $pbx_params['PBX_HMAC'] = $hmac;
+    $hmac_alg = strtolower($pbx_params['PBX_HASH']);
+    $hmac = hash_hmac($hmac_alg, $msg, $binkey);
+    $pbx_params['PBX_HMAC'] = strtoupper($hmac);
   }
 
   // Order of the fields NEEDS to be kept between form and
