Reorganize settings initialization to work better.