Fixes for testing and memcache