Fixed handing of dirs in export.