Fixes to SerialInputStream