Changed the settings code a little bit.