Improving typing and variable scope in ChunkedRequestAssembler.