Fix cacheAsBitmap. Last few commits broke it