--- memcache.inc	Thu Mar 17 06:58:42 2011
+++ memcache.new.inc	Sun Mar 20 00:55:20 2011
@@ -17,7 +17,7 @@
     $this->wildcard_flushes = variable_get('memcache_wildcard_flushes', array());
     $this->invalidate = variable_get('memcache_wildcard_invalidate', MEMCACHE_WILDCARD_INVALIDATE);
     $this->cache_lifetime = variable_get('cache_lifetime', 0);
-    $this->cache_flush = variable_get('cache_flush_' . $this->bin);
+	$this->cache_flush = variable_get('cache_flush_' . $this->bin, NULL);
     $this->flushed = min($this->cache_flush, REQUEST_TIME - $this->cache_lifetime);
   }
   function get($cid) {
@@ -99,6 +99,7 @@
 
   function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {
     $created = REQUEST_TIME;
+	$headers = isset($headers) ? serialize($headers) : NULL;
 
     // Create new cache object.
     $cache = new stdClass;
@@ -106,6 +107,7 @@
     $cache->data = is_object($data) ? clone $data : $data;
     $cache->created = $created;
     $cache->headers = $headers;
+
     // Record the previous number of wildcard flushes affecting our cid.
     $cache->flushes = $this->wildcard_flushes($cid);
     if ($expire == CACHE_TEMPORARY) {
