Fix debug and UART code.