Handled exceptions in Settings.writeLog() and added a restore default settings option.