Serial port and debug improvements