Fix bugs with cache-on-read.