fixing some hidden bugs in serialcom