Fixed poor initilization causing uncertain output.
Be more tolerant of connection dropouts and try to reconnect.