Fix bug in export