Detect broken connection
Improve error detection
Log timestamps