Caching (fixes #31)