Fix a stacktrace when the directory does not exist