Fix setting of preferences