Add handling of IncompleteRead error to POST requests to Galaxy. Code cleanup.