Fix handling of read timeout