Fixed crash on saving main settings