Fixed UART bugs