Fix serial communication bug