Fixing encoding and chunking issues.