Allow symlinks that are not parent directories

This allows the use of symlinks, but check to make sure that it's not a symlink to a parent directory, to avoid infinite loops.