Fix client with cache disabled, and a use-after-free