BUG: Revert the change to FileIsDirectory. Add FileIsSymlink and treat symlinks as files when removing directory