Bug fixes for the new cache code.