diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 157a6c4..45f7fd8 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -635,18 +635,22 @@
 
     <!-- Titles for app process limit preference. [CHAR LIMIT=35] -->
     <string-array name="app_process_limit_entries">
-        <item>No app process limit</item>
-        <item>Max 1 app process</item>
-        <item>Max 2 app processes</item>
-        <item>Max 3 app processes</item>
+        <item>Standard limit</item>
+        <item>No background processes</item>
+        <item>At most 1 process</item>
+        <item>At most 2 processes</item>
+        <item>At most 3 processes</item>
+        <item>At most 4 processes</item>
     </string-array>
 
     <!-- Values for app process limit preference. -->
     <string-array name="app_process_limit_values" translatable="false" >
+        <item>-1</item>
         <item>0</item>
         <item>1</item>
         <item>2</item>
         <item>3</item>
+        <item>4</item>
     </string-array>
 
     <!-- Match this with the constants in VpnProfile. --> <skip />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 90f3c3f..3719f73 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3340,13 +3340,13 @@
     <string name="debug_applications_category">Applications</string>
 
     <!-- UI debug setting: immediately destroy activities? [CHAR LIMIT=25] -->
-    <string name="immediately_destroy_activities">Immediately destroy activities</string>
+    <string name="immediately_destroy_activities">Don\'t keep activities</string>
     <!-- UI debug setting: immediately destroy activities summary [CHAR LIMIT=50] -->
     <string name="immediately_destroy_activities_summary">Destroy every activity as soon as
             the user leaves it</string>
 
-    <!-- UI debug setting: limit number of running application processes [CHAR LIMIT=25] -->
-    <string name="app_process_limit_title">Application process limit</string>
+    <!-- UI debug setting: limit number of running background processes [CHAR LIMIT=25] -->
+    <string name="app_process_limit_title">Background process limit</string>
 
     <!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
     <string name="data_usage_summary_title">Data usage</string>
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 9692dd5..10afd55 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -103,11 +103,14 @@
         mShowScreenUpdates = (CheckBoxPreference) findPreference(SHOW_SCREEN_UPDATES_KEY);
         mShowCpuUsage = (CheckBoxPreference) findPreference(SHOW_CPU_USAGE_KEY);
         mWindowAnimationScale = (ListPreference) findPreference(WINDOW_ANIMATION_SCALE_KEY);
+        mWindowAnimationScale.setOnPreferenceChangeListener(this);
         mTransitionAnimationScale = (ListPreference) findPreference(TRANSITION_ANIMATION_SCALE_KEY);
+        mTransitionAnimationScale.setOnPreferenceChangeListener(this);
 
         mImmediatelyDestroyActivities = (CheckBoxPreference) findPreference(
                 IMMEDIATELY_DESTROY_ACTIVITIES_KEY);
         mAppProcessLimit = (ListPreference) findPreference(APP_PROCESS_LIMIT_KEY);
+        mAppProcessLimit.setOnPreferenceChangeListener(this);
 
         removeHdcpOptionsForProduction();
     }
@@ -276,10 +279,12 @@
                 float val = Float.parseFloat(values[i].toString());
                 if (scale <= val) {
                     pref.setValueIndex(i);
+                    pref.setSummary(pref.getEntries()[i]);
                     return;
                 }
             }
             pref.setValueIndex(values.length-1);
+            pref.setSummary(pref.getEntries()[0]);
         } catch (RemoteException e) {
         }
     }
@@ -289,9 +294,9 @@
         updateAnimationScaleValue(1, mTransitionAnimationScale);
     }
 
-    private void writeAnimationScaleOption(int which, ListPreference pref) {
+    private void writeAnimationScaleOption(int which, ListPreference pref, Object newValue) {
         try {
-            float scale = Float.parseFloat(pref.getValue().toString());
+            float scale = Float.parseFloat(newValue.toString());
             mWindowManager.setAnimationScale(which, scale);
         } catch (RemoteException e) {
         }
@@ -305,17 +310,19 @@
                 int val = Integer.parseInt(values[i].toString());
                 if (val >= limit) {
                     mAppProcessLimit.setValueIndex(i);
+                    mAppProcessLimit.setSummary(mAppProcessLimit.getEntries()[i]);
                     return;
                 }
             }
             mAppProcessLimit.setValueIndex(0);
+            mAppProcessLimit.setSummary(mAppProcessLimit.getEntries()[0]);
         } catch (RemoteException e) {
         }
     }
 
-    private void writeAppProcessLimitOptions() {
+    private void writeAppProcessLimitOptions(Object newValue) {
         try {
-            int limit = Integer.parseInt(mAppProcessLimit.getValue().toString());
+            int limit = Integer.parseInt(newValue.toString());
             ActivityManagerNative.getDefault().setProcessLimit(limit);
         } catch (RemoteException e) {
         }
@@ -361,19 +368,32 @@
             writeFlingerOptions();
         } else if (preference == mShowCpuUsage) {
             writeCpuUsageOptions();
-        } else if (preference == mWindowAnimationScale) {
-            writeAnimationScaleOption(0, mWindowAnimationScale);
-        } else if (preference == mTransitionAnimationScale) {
-            writeAnimationScaleOption(1, mTransitionAnimationScale);
         } else if (preference == mImmediatelyDestroyActivities) {
             writeImmediatelyDestroyActivitiesOptions();
-        } else if (preference == mAppProcessLimit) {
-            writeAppProcessLimitOptions();
         }
 
         return false;
     }
 
+    @Override
+    public boolean onPreferenceChange(Preference preference, Object newValue) {
+        if (HDCP_CHECKING_KEY.equals(preference.getKey())) {
+            SystemProperties.set(HDCP_CHECKING_PROPERTY, newValue.toString());
+            updateHdcpValues();
+            return true;
+        } else if (preference == mWindowAnimationScale) {
+            writeAnimationScaleOption(0, mWindowAnimationScale, newValue);
+            return true;
+        } else if (preference == mTransitionAnimationScale) {
+            writeAnimationScaleOption(1, mTransitionAnimationScale, newValue);
+            return true;
+        } else if (preference == mAppProcessLimit) {
+            writeAppProcessLimitOptions(newValue);
+            return true;
+        }
+        return false;
+    }
+
     private void dismissDialog() {
         if (mOkDialog == null) return;
         mOkDialog.dismiss();
@@ -403,14 +423,4 @@
         dismissDialog();
         super.onDestroy();
     }
-
-    @Override
-    public boolean onPreferenceChange(Preference preference, Object newValue) {
-        if (HDCP_CHECKING_KEY.equals(preference.getKey())) {
-            SystemProperties.set(HDCP_CHECKING_PROPERTY, newValue.toString());
-            updateHdcpValues();
-            return true;
-        }
-        return false;
-    }
 }
