A better fix for csv downloads.

Fixes #406