Fixed some bugs in export file