Fix a small bug in the video engine