Fixed a cache usage issue and a logging issue