Tests and fixes adding an existing directory