Fixed #1166: Tweaks to import/export support

Signed-off-by: Anton Kovalyov <anton@kovalyov.net>