diff --git a/tests/xero-connection.test b/tests/xero-connection.test
index f957651..86c1ce5 100644
--- a/tests/xero-connection.test
+++ b/tests/xero-connection.test
@@ -51,16 +51,16 @@ class XeroConnectionTest extends DrupalUnitTestCase {
    $this->assertNotEqual($secret, '', t('Xero Consumer Secret is not empty.'));
   }
 
-// @todo This test is broken
-/*
+  // @note this test functions only with PHP-Xero from https://github.com/mradcliffe/PHP-Xero
   public function testXeroConnection() {
     $xero = xero_php_load();
 
-    $this->assertNotNull($xero, t('Sucessfully initialized the PHP-Xero library.'));
+    $this->assertNotNull($xero->verify(), t('Successfully initialized the PHP-Xero library.'));
 
-    $result = $xero->Accounts;
+    // I don't usually do it this way.
+    $result = json_decode($xero->Accounts);
 
-    $this->assertNotNull($result['Accounts']['Account'][0]['Name'], t('Successfully queried xero for accounts. Found an account named @name', array('@name' => $result['Accounts']['Account'][0]['Name'])));
+    $this->assertNotNull($result->Accounts[0]->Name, t('Successfully queried xero for accounts. Found an account named @name', array('@name' => json_encode($result->Accounts[0]->Name))));
   }
-*/
+
 }
diff --git a/xero.admin.inc b/xero.admin.inc
index 0689208..935fead 100644
--- a/xero.admin.inc
+++ b/xero.admin.inc
@@ -15,6 +15,7 @@ function xero_admin_settings() {
     '#title' => t('Xero Consumer Key'),
     '#description' => t('Provide the consumer key for your private application on xero.'),
     '#default_value' => variable_get('xero_consumer_key', ''),
+    '#required' => TRUE,
   );
 
   $form['xero_consumer_secret'] = array(
@@ -22,6 +23,7 @@ function xero_admin_settings() {
     '#title' => t('Xero Consumer Secret'),
     '#description' => t('Provide the consumer secret for your private application on xero.'),
     '#default_value' => variable_get('xero_consumer_secret', ''),
+    '#required' => TRUE,
   );
 
   $form['xero_cert_path'] = array(
@@ -29,6 +31,8 @@ function xero_admin_settings() {
     '#title' => t('Xero Certificate Path'),
     '#description' => t('Provide the full path and file name to your Xero certificate.'),
     '#default_value' => variable_get('xero_cert_path', ''),
+    '#element_validate' => array('xero_admin_settings_validate_exists'),
+    '#required' => TRUE,
   );
 
   $form['xero_key_path'] = array(
@@ -36,12 +40,23 @@ function xero_admin_settings() {
     '#title' => t('Xero Key Path'),
     '#description' => t('Provide the full path and file name to your Xero certificate private key.'),
     '#default_value' => variable_get('xero_key_path', ''),
+    '#element_validate' => array('xero_admin_settings_validate_exists'),
+    '#required' => TRUE,
   );
 
   return system_settings_form($form);
 }
 
 /**
+ * Validation callback for xero_admin_settings().  Verifies that the field's file exists and is readable.
+ */
+function xero_admin_settings_validate_exists($element, &$form_state) {
+  if (!@file_exists($element['#value'])) {
+    form_error($element, t('The specified file either does not exist, or is not accessible to the web server.'));
+  }
+}
+
+/**
  * Xero Autocomplete Contacts page callback
  * @param $string the string to search
  */
diff --git a/xero.module b/xero.module
index db78cb6..a7ad4d8 100644
--- a/xero.module
+++ b/xero.module
@@ -185,7 +185,7 @@ function xero_php_load() {
 function xero_query($type = 'get', $action, $id = FALSE, $after = FALSE, $items = array()) {
   $xero = xero_php_load();
 
-  if (!is_object($xero)) {
+  if (!$xero->verify()) {
     xero_error(0, '', 'Error trying to make a xero connection object.');
     return NULL;
   }
