Fixes for chunked transfer and sendfile