Added preferences to change default period length.