cppcheck fixes.
vera++ style checks.
Fixes to the command line to detect timeouts and disconnections.
More fixes.