some fixes in the export/import routine

Signed-off-by: Alexander Skjolden <alex@plastboks.net>