Fixed cache infinite loop.