Fix crash in reading settings.