Added preferences. Random small fixes