Fix garbage being displayed when resizing in CALayer mode