diff --git a/src/cc/AsyncComm/CommHeader.cc b/src/cc/AsyncComm/CommHeader.cc
index 3a8c4e1..87d8cee 100644
--- a/src/cc/AsyncComm/CommHeader.cc
+++ b/src/cc/AsyncComm/CommHeader.cc
@@ -48,6 +48,7 @@ void CommHeader::encode(uint8_t **bufp) {
 
 void CommHeader::decode(const uint8_t **bufp, size_t *remainp) {
   const uint8_t *base = *bufp;
+  HT_ASSERT(*remainp >= FIXED_LENGTH);
   HT_TRY("decoding comm header",
          version = Serialization::decode_i8(bufp, remainp);
          header_len = Serialization::decode_i8(bufp, remainp);
diff --git a/src/cc/Hypertable/RangeServer/AccessGroup.h b/src/cc/Hypertable/RangeServer/AccessGroup.h
index 1e3f5fb..58614b1 100644
--- a/src/cc/Hypertable/RangeServer/AccessGroup.h
+++ b/src/cc/Hypertable/RangeServer/AccessGroup.h
@@ -102,6 +102,11 @@ namespace Hypertable {
 
     void initiate_compaction();
 
+    bool compaction_initiated() {
+      ScopedLock lock(m_mutex);
+      return (bool)m_immutable_cache_ptr;
+    }
+
     const char *get_name() { return m_name.c_str(); }
 
     int shrink(String &split_row, bool drop_high);
diff --git a/src/cc/Hypertable/RangeServer/Range.cc b/src/cc/Hypertable/RangeServer/Range.cc
index bb6a55f..f5ab510 100644
--- a/src/cc/Hypertable/RangeServer/Range.cc
+++ b/src/cc/Hypertable/RangeServer/Range.cc
@@ -700,7 +700,8 @@ void Range::run_compaction(bool major) {
   }
 
   for (size_t i=0; i<m_access_group_vector.size(); i++)
-    m_access_group_vector[i]->run_compaction(major);
+    if (m_access_group_vector[i]->compaction_initiated())
+      m_access_group_vector[i]->run_compaction(major);
 }
 
 
