Missing ends in export_txt