fix bugs which cause build-error.
add public property 'debug' to SerialPort class for printf-debugging.