Fix a small bug where sometimes a red pixel would appear