Fix caching bug and update docs.