VIVO-588 Fixed a typo to fix the deadlocked threads.
VIVO-581 Don’t check for “regular files”, just check for “not directory”.