diff --git a/Drupal_Apache_Solr_Service.php b/Drupal_Apache_Solr_Service.php
index a8ab116..56be61b 100644
--- a/Drupal_Apache_Solr_Service.php
+++ b/Drupal_Apache_Solr_Service.php
@@ -723,7 +723,7 @@ class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
     $optimizeValue = $optimize ? 'true' : 'false';
     $flushValue = $waitFlush ? 'true' : 'false';
     $searcherValue = $waitSearcher ? 'true' : 'false';
-    $softCommit = $this->softCommit ? 'true' : 'false';
+    $softCommit = $this->soft_commit ? 'true' : 'false';
 
     $solr_version = $this->getSolrVersion();
     if ($solr_version <= 3) {
@@ -783,7 +783,9 @@ class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
    * @throws Exception If an error occurs during the service call
    */
   public function deleteByQuery($rawQuery, $timeout = 3600) {
+    dsm($rawQuery);
     $rawPost = '<delete><query>' . htmlspecialchars($rawQuery, ENT_NOQUOTES, 'UTF-8') . '</query></delete>';
+    dsm($rawPost);
 
     return $this->update($rawPost, $timeout);
   }
diff --git a/apachesolr.api.php b/apachesolr.api.php
index 9769043..1875935 100644
--- a/apachesolr.api.php
+++ b/apachesolr.api.php
@@ -232,13 +232,13 @@ function hook_apachesolr_delete_by_query_alter($query) {
  *
  * @param string $entity_id
  * @param string $entity_type
- * @param array $row
+ * @param object $row
  *   A complete set of data from the indexing table.
  * @param string $env_id
  *   The machine name of the environment.
  * @return boolean
  */
-function hook_apachesolr_exclude($entity_id, $entity_type, array $row, $env_id) {
+function hook_apachesolr_exclude($entity_id, $entity_type, $row, $env_id) {
   // Never index media entities to core_1
   if ($entity_type == 'media' && $env_id == 'core_1') {
     return TRUE;
@@ -252,13 +252,13 @@ function hook_apachesolr_exclude($entity_id, $entity_type, array $row, $env_id)
  * the entity is skipped for indexing.
  *
  * @param string $entity_id
- * @param array $row
+ * @param object $row
  *   A complete set of data from the indexing table.
  * @param string $env_id
  *   The machine name of the environment.
  * @return boolean
  */
-function hook_apachesolr_ENTITY_TYPE_exclude($entity_id, array $row, $env_id) {
+function hook_apachesolr_ENTITY_TYPE_exclude($entity_id, $row, $env_id) {
   // Never index ENTITY_TYPE to core_1
   if ($env_id == 'core_1') {
     return TRUE;
diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index e764504..91d05ec 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -71,16 +71,16 @@ function apachesolr_index_entities($env_id, $limit) {
  * Convert a certain entity from the apachesolr index table to a set of documents. 1 entity
  * can be converted in multiple documents if the apachesolr_index_entity_to_documents decides to do so.
  *
- * @param $row
+ * @param array $row
  *   A row from the indexing table
- * @param $entity_type
+ * @param string $entity_type
  *   The type of the entity
- * @param $env_id
+ * @param string $env_id
  *   The machine name of the environment.
  *
  * @return array of ApacheSolrDocument(s)
  */
-function apachesolr_index_entities_document(array $row, $entity_type, $env_id) {
+function apachesolr_index_entities_document($row, $entity_type, $env_id) {
   $documents = array();
   if (!empty($row->status)) {
     // Let any module exclude this entity from the index.
@@ -620,6 +620,7 @@ function apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entit
     $document_id = apachesolr_document_id($entity_id, $entity_type);
     $query = "id:$document_id OR sm_parent_document_id:$document_id";
     $solr->deleteByQuery($query);
+    $solr->deleteById($document_id);
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
     return TRUE;
   }
@@ -972,7 +973,7 @@ function apachesolr_term_reference_indexing_callback($node, $field_name, $index_
     $field = $node->$field_name;
     list($lang, $items) = each($field);
     foreach ($items as $item) {
-      // Triple indexing of tids lets us do effecient searches (on tid)
+      // Triple indexing of tids lets us do efficient searches (on tid)
       // and do accurate per field or per-vocabulary faceting.
 
       // By including the ancestors to a term in the index we make
@@ -987,10 +988,14 @@ function apachesolr_term_reference_indexing_callback($node, $field_name, $index_
         // regardless of whether the facet is set to show as a hierarchy or not.
         // We would need a separate field if we were to index terms without any
         // hierarchy at all.
-        $fields[] = array(
-          'key' => $index_key,
-          'value' => $ancestor->tid,
-        );
+        // If the term is singular, then we cannot add another value to the
+        // document as the field is single
+        if ($field_info['multiple'] == true) {
+          $fields[] = array(
+            'key' => $index_key,
+            'value' => $ancestor->tid,
+          );
+        }
         $fields[] = array(
           'key' => 'tid',
           'value' => $ancestor->tid,
diff --git a/apachesolr.module b/apachesolr.module
index 1e29e9f..0291a48 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -1104,6 +1104,9 @@ function apachesolr_set_default_environment($env_id) {
  *     watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
  *   }
  *
+ *
+ * @param string $env_id
+ * @return DrupalApacheSolrServiceInterface $solr
  * @throws Exception
  */
 function apachesolr_get_solr($env_id = NULL) {
