Fixed all serial communication bugs