Made caching work properly.