Settings: Fix up and optimize

Change-Id: I55883174a3472b64a4783cafc8b8a12406429d13