Improve code readablity.
Add handling of IncompleteRead error.  Code cleanup.