Bug: "basename" don't resolve directory name, but "dirname" does ;)