Fix for pwds with symlinks as a directory component