Fixed severe bugs in Memcache integration