Fixed bug in export script.