Fix export to Excel functionality