Fix crashes in settings