Fix cache hit logic.