Fix the 'this' context for the caching functions