Fix for PDF downloads