Added a test for missing trailing slash for dirs.
Improved the path recursion algorithm for defaultForNew.
Add missing trailing slashes for dirs in PathInfo().