diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index bed3be5..4edda7d 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -745,9 +745,13 @@
 
         long start = currentTime;
         long end = currentTime;
-        if (history.bucketCount > 0) {
-            start = history.bucketStart[0];
-            end = history.bucketStart[history.bucketCount - 1];
+
+        NetworkStatsHistory.Entry entry = null;
+        if (history.size() > 0) {
+            entry = history.getValues(0, entry);
+            start = entry.bucketStart;
+            entry = history.getValues(history.size() - 1, entry);
+            end = entry.bucketStart + entry.bucketDuration;
         }
 
         return new long[] { start, end };
@@ -1081,11 +1085,12 @@
             mItems.clear();
 
             if (stats != null) {
-                for (int i = 0; i < stats.size; i++) {
-                    final long total = stats.rx[i] + stats.tx[i];
+                NetworkStats.Entry entry = null;
+                for (int i = 0; i < stats.size(); i++) {
+                    entry = stats.getValues(i, entry);
                     final AppUsageItem item = new AppUsageItem();
-                    item.uid = stats.uid[i];
-                    item.total = total;
+                    item.uid = entry.uid;
+                    item.total = entry.rxBytes + entry.txBytes;
                     mItems.add(item);
                 }
             }
diff --git a/src/com/android/settings/SettingsCheckBoxPreference.java b/src/com/android/settings/SettingsCheckBoxPreference.java
index 6acdfe8..026e4e6 100644
--- a/src/com/android/settings/SettingsCheckBoxPreference.java
+++ b/src/com/android/settings/SettingsCheckBoxPreference.java
@@ -61,16 +61,9 @@
     @Override
     protected void onBindView(View view) {
         super.onBindView(view);
-
         ImageView settingsButton = (ImageView) view.findViewById(R.id.settings_button);
-        if (settingsButton == null) {
-            return;
-        }
         if (mSettingsIntent != null) {
             CheckBox checkbox = (CheckBox) view.findViewById(com.android.internal.R.id.checkbox);
-            if (checkbox == null) {
-                return;
-            }
             if (checkbox.isChecked()) {
                 settingsButton.setOnClickListener(new OnClickListener() {
                     public void onClick(View view) {
@@ -86,6 +79,7 @@
             }
         } else {
             settingsButton.setVisibility(View.GONE);
+            view.findViewById(R.id.divider).setVisibility(View.GONE);
         }
     }
 }
diff --git a/src/com/android/settings/widget/ChartNetworkSeriesView.java b/src/com/android/settings/widget/ChartNetworkSeriesView.java
index 83c10cd..10d8976 100644
--- a/src/com/android/settings/widget/ChartNetworkSeriesView.java
+++ b/src/com/android/settings/widget/ChartNetworkSeriesView.java
@@ -140,7 +140,7 @@
         mPathFill.reset();
 
         // bail when not enough stats to render
-        if (mStats == null || mStats.bucketCount < 2) return;
+        if (mStats == null || mStats.size() < 2) return;
 
         final int width = getWidth();
         final int height = getHeight();
@@ -155,8 +155,11 @@
 
         long totalData = 0;
 
-        for (int i = 0; i < mStats.bucketCount; i++) {
-            final float x = mHoriz.convertToPoint(mStats.bucketStart[i]);
+        NetworkStatsHistory.Entry entry = null;
+        for (int i = 0; i < mStats.size(); i++) {
+            entry = mStats.getValues(i, entry);
+
+            final float x = mHoriz.convertToPoint(entry.bucketStart);
             final float y = mVert.convertToPoint(totalData);
 
             // skip until we find first stats on screen
@@ -170,7 +173,7 @@
             if (started) {
                 mPathStroke.lineTo(x, y);
                 mPathFill.lineTo(x, y);
-                totalData += mStats.rx[i] + mStats.tx[i];
+                totalData += entry.rxBytes + entry.txBytes;
             }
 
             // skip if beyond view
