serial driver bugfixes and helpers