Fix issues with screen capture