Bitmap caching and bug fixes