Fix dir check

It makes no sense here to return true if a given directory is not a directory. This should be an error.