diff --git a/includes/recurly.pages.inc b/includes/recurly.pages.inc
index 22af586..dfb522b 100644
--- a/includes/recurly.pages.inc
+++ b/includes/recurly.pages.inc
@@ -119,7 +119,8 @@ function recurly_subscription_list_page($entity_type, $entity) {
       '#total' => recurly_format_currency($total, $subscription->currency),
       '#subscription_links' => $links ? theme('links', array(
         'links' => $links,
-        'attributes' => array('class' => array('inline', 'links')))) : NULL,
+        'attributes' => array('class' => array('inline', 'links')),
+      )) : NULL,
       '#message' => $message,
       '#subscription' => $subscription,
       '#account' => $account,
@@ -665,7 +666,7 @@ function recurly_subscription_cancel_confirm($form, $form_state, $entity_type, $
   );
   $form['cancel']['description'] = array(
     '#type' => 'markup',
-    '#markup' => '<p>' . t('Canceling a subscription will cause it not to renew. If you cancel the subscription, it will continue until <strong>@date</strong>. On that date, the subscription will expire and not be invoiced again. The subscription can be reactivated before it expires.', array('@date' => recurly_format_date($subscription->current_period_ends_at)))  . '</p>',
+    '#markup' => '<p>' . t('Canceling a subscription will cause it not to renew. If you cancel the subscription, it will continue until <strong>@date</strong>. On that date, the subscription will expire and not be invoiced again. The subscription can be reactivated before it expires.', array('@date' => recurly_format_date($subscription->current_period_ends_at))) . '</p>',
   );
   $form['cancel']['actions'] = array(
     '#type' => 'actions',
@@ -794,7 +795,6 @@ function template_preprocess_recurly_subscription_cancel_confirm(&$variables) {
   $variables['past_due'] = isset($_GET['past_due']) && $_GET['past_due'] === '1';
 }
 
-
 /**
  * Menu callback; Reactivate a subscription immediately and redirect.
  */
@@ -959,10 +959,10 @@ function recurly_subscription_redeem_coupon($form, &$form_state, $entity_type, $
   // and if they need to confirm replacing their coupon with a new one.
   if ($confirming_replacement_coupon) {
     $form_state['confirmed'] = TRUE;
-    $help = '<p>' . t('Your account already has a coupon that will be applied to your next invoice. Are you sure you want to replace your existing coupon "!old_coupon" with "!new_coupon"? You may not be able to use your previous coupon again.',
-      array(
-        '!old_coupon' => recurly_format_coupon($form_state['existing_coupon'], $form_state['existing_redemption']->currency),
-        '!new_coupon' => recurly_format_coupon($form_state['coupon'], $form_state['values']['coupon_currency']))) . '</p>';
+    $help = '<p>' . t('Your account already has a coupon that will be applied to your next invoice. Are you sure you want to replace your existing coupon "!old_coupon" with "!new_coupon"? You may not be able to use your previous coupon again.', array(
+      '!old_coupon' => recurly_format_coupon($form_state['existing_coupon'], $form_state['existing_redemption']->currency),
+      '!new_coupon' => recurly_format_coupon($form_state['coupon'], $form_state['values']['coupon_currency']),
+    )) . '</p>';
   }
   elseif ($account->redemption) {
     $form_state['existing_redemption'] = $account->redemption->get();
@@ -1042,7 +1042,7 @@ function recurly_subscription_redeem_coupon_submit($form, &$form_state) {
   if ($account && $coupon && $account->redemption) {
     // If the user already has a coupon, rebuild the form and ask confirmation.
     if (empty($form_state['confirmed'])) {
-      drupal_set_message('You already have an active coupon, are you sure you want to replace it?', 'warning');
+      drupal_set_message(t('You already have an active coupon, are you sure you want to replace it?', 'warning'));
       $form_state['confirm'] = TRUE;
       $form_state['rebuild'] = TRUE;
       return;
diff --git a/recurly.module b/recurly.module
index 94ef60c..71574d2 100644
--- a/recurly.module
+++ b/recurly.module
@@ -587,7 +587,7 @@ function recurly_process_push_notification($key, $subdomain = NULL) {
  *   TRUE or FALSE indicating whether or not the client was initialized with the
  *   specified account settings.
  */
-function recurly_client_initialize($settings = NULL, $reset = FALSE) {
+function recurly_client_initialize(array $settings = NULL, $reset = FALSE) {
   static $initialized = FALSE;
   $client = NULL;
 
@@ -614,7 +614,7 @@ function recurly_client_initialize($settings = NULL, $reset = FALSE) {
     require_once $path . '/lib/recurly.php';
 
     // Required for the API.
-    Recurly_Client::$apiKey = $settings['api_key'];
+    Recurly_Client::$apikey = $settings['api_key'];
   }
   else {
     watchdog('recurly', 'Could not find the Recurly PHP client library in sites/all/libraries/recurly.', array(), WATCHDOG_ERROR);
@@ -642,7 +642,7 @@ function recurly_client_initialize($settings = NULL, $reset = FALSE) {
  *   include an additional 'orphaned' property set to TRUE. Returns FALSE if no
  *   data can be found locally at all.
  */
-function recurly_account_load($conditions = array(), $local = FALSE) {
+function recurly_account_load(array $conditions = array(), $local = FALSE) {
   // Create a base select query object.
   $query = db_select('recurly_account', 'ra')->fields('ra');
 
@@ -965,7 +965,7 @@ function _recurly_user_access($op, $account) {
 
 /**
  * Returns an array of subscription plan objects for the current account.
- * 
+ *
  * Retrieves them from a local cache if possible.
  *
  * @param bool $reset_cache
@@ -1056,7 +1056,7 @@ function recurly_hosted_url($path = '') {
  *   A string containing a URL for the operation, or NULL if no module is
  *   available to handle the operation.
  */
-function recurly_url($operation, $context) {
+function recurly_url($operation, array $context) {
   $urls = module_invoke_all('recurly_url_info', $operation, $context);
   $return_url = NULL;
   foreach ($urls as $url) {
