2 more fixes related to chunked transfers

The 2 rebased commits from before. Also you current HEAD does not compile without Rank2Types. I had to remove the offending function signature for it to compile.