Added check for IncompleteRead exception.