Fixed bug in settings handling