Factored locale related code in main() to a new function.
Removed unnecessary call to check_prefs_dir() in load_config().
This function is called in save_config(), where it is actually needed.