diff --git a/commerce_discount.module b/commerce_discount.module
index 25795c9..fa47314 100644
--- a/commerce_discount.module
+++ b/commerce_discount.module
@@ -90,6 +90,7 @@ function commerce_discount_entity_info() {
     'entity class' => 'CommerceDiscount',
     'base table' => 'commerce_discount',
     'fieldable' => TRUE,
+    'redirect' => FALSE,
     'exportable' => TRUE,
     'entity keys' => array(
       'id' => 'discount_id',
@@ -187,7 +188,7 @@ function commerce_discount_views_api($module, $api) {
   if ($module == 'views') {
     return array(
       'version' => 3,
-      'path' => drupal_get_path('module','commerce_discount') . '/includes/views',
+      'path' => drupal_get_path('module', 'commerce_discount') . '/includes/views',
     );
   }
 }
@@ -498,7 +499,7 @@ function commerce_discount_offer_type_get_name($type = NULL) {
  */
 function commerce_discount_entity_list() {
   $options = array();
-  foreach(entity_load('commerce_discount') as $discount) {
+  foreach (entity_load('commerce_discount') as $discount) {
     $options[$discount->name] = $discount->label;
   }
 
@@ -529,4 +530,3 @@ function commerce_discount_commerce_line_item_type_info() {
 function commerce_discount_line_item_title() {
   return t('Fixed amount discount');
 }
-
diff --git a/commerce_discount.rules.inc b/commerce_discount.rules.inc
index 1b22004..60bd9b0 100644
--- a/commerce_discount.rules.inc
+++ b/commerce_discount.rules.inc
@@ -43,7 +43,9 @@ function commerce_discount_rules_event_info() {
     'commerce_discount_order' => array(
       'label' => t('Apply a discount to a given order'),
       'group' => t('Commerce - discount'),
-      'variables' => entity_rules_events_variables('commerce_order', t('Order', array(), array('context' => 'a drupal commerce order'))),
+      'variables' => entity_rules_events_variables(
+        'commerce_order',
+        t('Order', array(), array('context' => 'a drupal commerce order'))),
       'access callback' => 'commerce_order_rules_access',
     ),
   );
@@ -51,7 +53,6 @@ function commerce_discount_rules_event_info() {
   return $items;
 }
 
-
 /**
  * Rules action: Apply fixed amount discount.
  */
@@ -66,7 +67,8 @@ function commerce_discount_fixed_amount(EntityDrupalWrapper $wrapper, $discount_
       // @todo: It doesn't work with the wrapper.
       $order = $wrapper->value();
       $delta = $wrapper->commerce_discounts->count();
-      $order->commerce_discounts[LANGUAGE_NONE][$delta]['target_id'] = $discount_wrapper->discount_id->value();
+      $order->commerce_discounts[LANGUAGE_NONE][$delta]['target_id']
+        = $discount_wrapper->discount_id->value();
 
       commerce_discount_add_line_item($wrapper, $discount_name, $discount_price);
 
@@ -82,7 +84,8 @@ function commerce_discount_fixed_amount(EntityDrupalWrapper $wrapper, $discount_
       $price_data = $wrapper->commerce_unit_price->data->value();
 
       foreach ($price_data['components'] as $component) {
-        if (!empty($component['price']['data']['discount_name']) && $component['price']['data']['discount_name'] == $discount_wrapper->getIdentifier()) {
+        if (!empty($component['price']['data']['discount_name'])
+          && $component['price']['data']['discount_name'] == $discount_wrapper->getIdentifier()) {
           return;
         }
       }
@@ -115,7 +118,8 @@ function commerce_discount_percentage(EntityDrupalWrapper $wrapper, $discount_na
       // @todo: It doesn't work with the wrapper.
       $order = $wrapper->value();
       $delta = $wrapper->commerce_discounts->count();
-      $order->commerce_discounts[LANGUAGE_NONE][$delta]['target_id'] = $discount_wrapper->discount_id->value();
+      $order->commerce_discounts[LANGUAGE_NONE][$delta]['target_id']
+        = $discount_wrapper->discount_id->value();
 
       $calculated_discount = 0;
       // Loop the line items of the order and calculate the total discount.
@@ -151,7 +155,8 @@ function commerce_discount_percentage(EntityDrupalWrapper $wrapper, $discount_na
       // Check whether this discount was already added as a price component.
       $price_data = $wrapper->commerce_unit_price->data->value();
       foreach ($price_data['components'] as $component) {
-        if (!empty($component['price']['data']['discount_name']) && $component['price']['data']['discount_name'] == $discount_name) {
+        if (!empty($component['price']['data']['discount_name'])
+          && $component['price']['data']['discount_name'] == $discount_name) {
           return;
         }
       }
@@ -171,11 +176,11 @@ function commerce_discount_percentage(EntityDrupalWrapper $wrapper, $discount_na
 /**
  * Creates a discount line item on the provided order.
  *
- * @param $order_wrapper
+ * @param object $order_wrapper
  *   The wrapped order entity.
- * @param $discount_name
+ * @param string $discount_name
  *   The name of the discount being applied.
- * @param $dicount_amount
+ * @param array $discount_amount
  *   The discount amount price array (amount, currency_code).
  */
 function commerce_discount_add_line_item($order_wrapper, $discount_name, $discount_amount) {
@@ -189,7 +194,8 @@ function commerce_discount_add_line_item($order_wrapper, $discount_name, $discou
 
   // Initialize the line item unit price.
   $discount_line_item_wrapper->commerce_unit_price->amount = 0;
-  $discount_line_item_wrapper->commerce_unit_price->currency_code = $discount_amount['currency_code'];
+  $discount_line_item_wrapper->commerce_unit_price->currency_code
+    = $discount_amount['currency_code'];
 
   // Reset the data array of the line item total field to only include a
   // base price component, set the currency code from the order.
@@ -198,10 +204,13 @@ function commerce_discount_add_line_item($order_wrapper, $discount_name, $discou
     'currency_code' => $discount_amount['currency_code'],
     'data' => array(),
   );
-  $discount_line_item_wrapper->commerce_unit_price->data = commerce_price_component_add($base_price, 'base_price', $base_price, TRUE);
+
+  $discount_line_item_wrapper->commerce_unit_price->data
+    = commerce_price_component_add($base_price, 'base_price', $base_price, TRUE);
 
   // Add the actual discount price component.
-  commerce_discount_add_price_component($discount_line_item_wrapper, $discount_name, $discount_amount);
+  commerce_discount_add_price_component($discount_line_item_wrapper,
+    $discount_name, $discount_amount);
 
   // Save the line item and add it to the order.
   $discount_line_item_wrapper->save();
@@ -211,11 +220,11 @@ function commerce_discount_add_line_item($order_wrapper, $discount_name, $discou
 /**
  * Adds a discount price component to the provided line item.
  *
- * @param $line_item_wrapper
+ * @param object $line_item_wrapper
  *   The wrapped line item entity.
- * @param $discount_name
+ * @param string $discount_name
  *   The name of the discount being applied.
- * @param $dicount_amount
+ * @param array $discount_amount
  *   The discount amount price array (amount, currency_code).
  */
 function commerce_discount_add_price_component($line_item_wrapper, $discount_name, $discount_amount) {
@@ -228,7 +237,8 @@ function commerce_discount_add_price_component($line_item_wrapper, $discount_nam
 
   // Calculate the updated amount and create a price array representing the
   // difference between it and the current amount.
-  $updated_amount = commerce_round(COMMERCE_ROUND_HALF_UP, $current_amount + $discount_amount['amount']);
+  $updated_amount = commerce_round(COMMERCE_ROUND_HALF_UP,
+    $current_amount + $discount_amount['amount']);
 
   $difference = array(
     'amount' => $discount_amount['amount'],
diff --git a/includes/commerce_discount.admin.inc b/includes/commerce_discount.admin.inc
index fac0bde..22926f2 100644
--- a/includes/commerce_discount.admin.inc
+++ b/includes/commerce_discount.admin.inc
@@ -37,7 +37,9 @@ class CommerceDiscountUIController extends EntityDefaultUIController {
         $function('commerce_discount', $entity, $form, $form_state);
       }
     }
-    field_attach_submit('commerce_discount', $entity, $form['commerce_discount_fields'], $form_state);
+    field_attach_submit('commerce_discount', $entity,
+      $form['commerce_discount_fields'], $form_state);
+
     return $entity;
   }
 
@@ -72,6 +74,7 @@ class CommerceDiscountUIController extends EntityDefaultUIController {
       'file' => 'includes/commerce_discount.admin.inc',
       'file path' => drupal_get_path('module', 'commerce_discount'),
     );
+
     return $items;
   }
 }
@@ -83,7 +86,8 @@ function commerce_discount_overview_form() {
   $view = views_get_view('commerce_discount_overview');
   $view->override_url = $_GET['q'];
   $form['view'] = array('#markup' => $view->preview());
-  $form['#attached']['css'][] = drupal_get_path('module', 'commerce_discount') . '/css/commerce_discount.css';
+  $form['#attached']['css'][] = drupal_get_path('module', 'commerce_discount') .
+    '/css/commerce_discount.css';
   return $form;
 }
 
@@ -94,6 +98,7 @@ function commerce_discount_get_action_title($op, $entity_type) {
   switch ($op) {
     case 'add':
       return t('Add discount');
+
     case 'import':
       return t('Import discount');
   }
@@ -102,9 +107,10 @@ function commerce_discount_get_action_title($op, $entity_type) {
 /**
  * Form callback: create or edit a discount.
  *
- * @param $discount
- *   The discount type array to edit or for a create form an empty discount
- *   type array with properties instantiated but not populated.
+ * @param array $form
+ * @param array $form_state
+ * @param CommerceDiscount $commerce_discount
+ * @param string $op
  */
 function commerce_discount_form($form, &$form_state, CommerceDiscount $commerce_discount, $op = 'edit') {
   // We might have gotten the commerce discount type via ajax, so set it
@@ -134,22 +140,24 @@ function commerce_discount_form($form, &$form_state, CommerceDiscount $commerce_
     '#required' => FALSE,
     '#default_value' => $commerce_discount->type,
     '#ajax' => array(
-       'callback' => 'commerce_discount_fields_ajax_callback',
-       'wrapper' => 'commerce-discount-fields-wrapper',
+      'callback' => 'commerce_discount_fields_ajax_callback',
+      'wrapper' => 'commerce-discount-fields-wrapper',
     ),
   );
 
   // Machine-readable type name.
   $form['name'] = array(
     '#type' => 'machine_name',
-    // Strip the 'discount_' prefix from the beginning of the string
-    '#default_value' => isset($commerce_discount->name) ? substr($commerce_discount->name, 9) : '',
+    // Strip the 'discount_' prefix from the beginning of the string.
+    '#default_value' => isset($commerce_discount->name) ?
+      substr($commerce_discount->name, 9) : '',
     '#disabled' => $commerce_discount->hasStatus(ENTITY_IN_CODE),
     '#machine_name' => array(
       'exists' => '_commerce_discount_name_exists',
       'source' => array('label'),
     ),
-    '#description' => t('A unique machine-readable name for this message type. It must only contain lowercase letters, numbers, and underscores.'),
+    '#description' => t('A unique machine-readable name for this message type.' .
+      '  It must only contain lowercase letters, numbers, and underscores.'),
     // 32 characters minus the 'discount_' prefix.
     '#maxlength' => 23,
     // This field should stay LTR even for RTL languages.
@@ -163,7 +171,9 @@ function commerce_discount_form($form, &$form_state, CommerceDiscount $commerce_
     '#tree' => TRUE,
     '#parents' => array('commerce_discount_fields'),
   );
-  field_attach_form('commerce_discount', $commerce_discount, $form['commerce_discount_fields'], $form_state);
+
+  field_attach_form('commerce_discount', $commerce_discount,
+    $form['commerce_discount_fields'], $form_state);
   // Remove the title and surrounding fieldset from the offer reference field.
   $form['commerce_discount_fields']['commerce_discount_offer'][LANGUAGE_NONE]['#title'] = NULL;
   $form['commerce_discount_fields']['commerce_discount_offer'][LANGUAGE_NONE]['#type'] = 'container';
@@ -173,7 +183,8 @@ function commerce_discount_form($form, &$form_state, CommerceDiscount $commerce_
   // ignored because their markup makes them hard to style generically.
   foreach (element_get_visible_children($form['commerce_discount_fields']) as $field_name) {
     $field = field_info_field($field_name);
-    if ($field_name == 'commerce_discount_offer' || in_array($field['type'], array('date', 'datestamp', 'datetime'))) {
+    if ($field_name == 'commerce_discount_offer'
+      || in_array($field['type'], array('date', 'datestamp', 'datetime'))) {
       continue;
     }
 
@@ -209,13 +220,15 @@ function commerce_discount_form($form, &$form_state, CommerceDiscount $commerce_
       '#value' => t('Delete discount'),
       '#weight' => 45,
       '#limit_validation_errors' => array(),
-      '#submit' => array('commerce_discount_form_submit_delete')
+      '#submit' => array('commerce_discount_form_submit_delete'),
     );
   }
 
   // Add assets.
-  $form['#attached']['js'][] = drupal_get_path('module', 'commerce_discount') . '/js/commerce_discount.js';
-  $form['#attached']['css'][] = drupal_get_path('module', 'commerce_discount') . '/css/commerce_discount.css';
+  $form['#attached']['js'][] = drupal_get_path('module', 'commerce_discount') .
+    '/js/commerce_discount.js';
+  $form['#attached']['css'][] = drupal_get_path('module', 'commerce_discount') .
+    '/css/commerce_discount.css';
   $form['#attributes']['class'][] = 'commerce-discount-form';
 
   return $form;
@@ -235,7 +248,8 @@ function commerce_discount_fields_ajax_callback($form, &$form_state) {
  * Form API validation callback for the type form.
  */
 function commerce_discount_form_validate($form, &$form_state) {
-  field_attach_form_validate('commerce_discount', $form_state['commerce_discount'], $form['commerce_discount_fields'], $form_state);
+  field_attach_form_validate('commerce_discount', $form_state['commerce_discount'],
+    $form['commerce_discount_fields'], $form_state);
 
   if (!empty($form_state['values']['name'])) {
     form_set_value($form['name'], 'discount_' . $form_state['values']['name'], $form_state);
@@ -255,17 +269,18 @@ function commerce_discount_form_submit(&$form, &$form_state) {
  * Form API submit callback for the delete button.
  */
 function commerce_discount_form_submit_delete(&$form, &$form_state) {
-  $form_state['redirect'] = 'admin/commerce/store/discounts/manage/' . $form_state['commerce_discount']->name . '/delete';
+  $form_state['redirect'] = 'admin/commerce/store/discounts/manage/' .
+    $form_state['commerce_discount']->name . '/delete';
 }
 
 
 /**
  * Checks if a Discount machine name is taken.
  *
- * @param $value
+ * @param string $value
  *   The machine name, not prefixed with 'discount_'.
  *
- * @return
+ * @return object
  *   Whether or not the field machine name is taken.
  */
 function _commerce_discount_name_exists($value) {
@@ -286,7 +301,9 @@ function commerce_discount_settings() {
     '#title' => t('Line item types to use for discounts'),
     '#default_value' => variable_get('commerce_discount_line_item_types', array('product')),
     '#options' => $types,
-    '#description' => t('Select the line item types that will be taken into account for calculating the discount amounts in percentage offers.'),
+    '#description' => t('Select the line item types that will be taken into ' .
+      'account for calculating the discount amounts in percentage offers.'),
   );
+
   return system_settings_form($form);
-}
\ No newline at end of file
+}
