Preferences added and minor bug squashing