Added exception handling for directory listing failure

Also added a print out of directories that could not be scanned at the
end.