Get the directory, not the path
Handle config file exceptions more gracefully