diff --git a/Drupal_Apache_Solr_Service.php b/Drupal_Apache_Solr_Service.php
index a8ab116..e9d1fe4 100644
--- a/Drupal_Apache_Solr_Service.php
+++ b/Drupal_Apache_Solr_Service.php
@@ -247,6 +247,13 @@ class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
     return $this->luke[$num_terms];
   }
 
+  /**
+   * Get the current solr version. This could be 1, 3 or 4
+   *
+   * @return int
+   *   1, 3 or 4. Does not give a more details version, for that you need
+   *   to get the system info.
+   */
   public function getSolrVersion() {
     $system_info = $this->getSystemInfo();
     // Get our solr version number
@@ -723,7 +730,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) {
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..2dd9e5e 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,12 @@ 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);
+
+    // Only for solr we delete the document ID for now
+    if ($solr->getSolrVersion() == '4') {
+      $solr->deleteById($document_id);
+    }
+    // Set our last updated timestamp
     apachesolr_set_last_index_updated($env_id, REQUEST_TIME);
     return TRUE;
   }
@@ -972,7 +978,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 +993,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.interface.inc b/apachesolr.interface.inc
index dca5295..d5f74f9 100644
--- a/apachesolr.interface.inc
+++ b/apachesolr.interface.inc
@@ -510,4 +510,14 @@ interface DrupalApacheSolrServiceInterface {
    * @throws Exception If an error occurs during the service call
    */
   function search($query = '', array $params = array(), $method = 'GET');
+
+    /**
+   * Get the current solr version. This could be 1, 3 or 4
+   *
+   * @return int
+   *   1, 3 or 4. Does not give a more details version, for that you need
+   *   to get the system info.
+   */
+  function getSolrVersion();
+
 }
diff --git a/apachesolr.module b/apachesolr.module
index 1e29e9f..118057f 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -1104,6 +1104,11 @@ 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) {
diff --git a/tests/Dummy_Solr.php b/tests/Dummy_Solr.php
index dac7dd8..cc2c782 100644
--- a/tests/Dummy_Solr.php
+++ b/tests/Dummy_Solr.php
@@ -241,7 +241,7 @@ class DummySolr implements DrupalApacheSolrServiceInterface {
     return $this->last_search;
   }
 
- /**
+  /**
    * Call the /admin/ping servlet, to test the connection to the server.
    *
    * @param $timeout
@@ -374,6 +374,7 @@ class DummySolr implements DrupalApacheSolrServiceInterface {
    * @param boolean $waitFlush Defaults to true
    * @param boolean $waitSearcher Defaults to true
    * @param float $timeout Maximum expected duration (in seconds) of the commit operation on the server (otherwise, will throw a communication exception). Defaults to 1 hour
+   * @param boolean $softCommit optimize by using a softCommit
    *
    * @return response object
    *
@@ -392,8 +393,8 @@ class DummySolr implements DrupalApacheSolrServiceInterface {
    *
    * @throws Exception If an error occurs during the service call
    */
-   function deleteById($id, $timeout = 3600) {
-   }
+  function deleteById($id, $timeout = 3600) {
+  }
 
   /**
    * Create and post a delete document based on multiple document IDs.
@@ -427,6 +428,7 @@ class DummySolr implements DrupalApacheSolrServiceInterface {
    * @param boolean $waitFlush
    * @param boolean $waitSearcher
    * @param float $timeout Maximum expected duration of the commit operation on the server (otherwise, will throw a communication exception)
+   * @param boolean $softCommit optimize by using a softCommit
    *
    * @return response object
    *
@@ -434,5 +436,15 @@ class DummySolr implements DrupalApacheSolrServiceInterface {
    */
   function optimize($waitFlush = TRUE, $waitSearcher = TRUE, $timeout = 3600, $softCommit = FALSE) {
   }
+
+  /**
+   * Get the current solr version. This could be 1, 3 or 4
+   *
+   * @return int
+   *   1, 3 or 4. Does not give a more details version, for that you need
+   *   to get the system info.
+   */
+  function getSolrVersion() {
+  }
 }
 
