Fixed bugs in downloadXLS