Fixed few bugs in export script.
Added test for altered export script.