Tweak root/dir

When dirname is empty, return /