Fixed a couple bugs when reading a file and received -1 for bytes read.
Gateway can now support multiple concurrent transfers with different
rates with small performance hit on faster transfers.