diff --git a/apachesolr.module b/apachesolr.module
index 3b5dd7b..02720a6 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -760,9 +760,12 @@ function apachesolr_set_last_index_position($env_id, $entity_type, $last_changed
 /**
  * Clear a specific environment, or clear all.
  */
-function apachesolr_clear_last_index_position($env_id, $entity_type = NULL) {
+function apachesolr_clear_last_index_position($env_id = NULL, $entity_type = NULL) {
   $stored = variable_get('apachesolr_index_last', array());
-  if ($entity_type) {
+  if (empty($env_id)) {
+    $stored = array();
+  }
+  elseif ($entity_type) {
     unset($stored[$env_id][$entity_type]);
   }
   else {
diff --git a/apachesolr_access/apachesolr_access.module b/apachesolr_access/apachesolr_access.module
index 3574179..bac5a28 100644
--- a/apachesolr_access/apachesolr_access.module
+++ b/apachesolr_access/apachesolr_access.module
@@ -122,7 +122,7 @@ function apachesolr_access_form_alter(&$form, $form_state, $form_id) {
 function apachesolr_access_rebuild_nodeaccess(&$form, $form_state) {
   drupal_set_message(t('Solr search index will be rebuilt.'));
   // Clear last updated
-  apachesolr_index_set_last_updated();
+  apachesolr_clear_last_index_position();
 }
 
 function apachesolr_access_enable() {
