Fix beginPaintBuffered().