Simplified the exception handling in caching code.
More const forcing and simplifications.