Improved stability of serial port. Added tail test script structure.