Fixes for caching

Both the ttl issue and also saving errors.