Added exception handling for setDTR/setRTS functions as well as flush function in flushBuffer.