Bugfixes for localStorage caching