improved serial communicatino and fixed device regex on Windows