Added check when writing serial device could be null and TODO note for when reading serial device.