Fix caching bug
Fixes #2