Fixes and improvements to the bitmap caches