bugfixes, and enabling caching