Fix when adding a new dir after selecting a file from tree.