Properly caching.

Now, just need to restore the cache. And some other stuff.