Fixed a couple of bugs, oops
Fxied errors in export script