Fix bug with cache locking solution.