fix issue with wrong map passed to add-directories; update test