Fix memory cache lookup handling