Updated to avoid symlinks in non-current directory.