Fix download issue with partial stream read