diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 775dad2..e3acf70 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1031,8 +1031,8 @@
         if (!state.doNotRestore) {
             if (state == LauncherState.ALL_APPS) {
                 showAppsView(false /* animated */);
-            } else {
-                // TODO: Add logic for other states
+            } else if (state == LauncherState.OVERVIEW) {
+                showOverviewMode(false);
             }
         }
 
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 5258fba..f55455b 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -49,7 +49,6 @@
 import com.android.launcher3.anim.PropertyListBuilder;
 import com.android.launcher3.pageindicators.PageIndicator;
 import com.android.launcher3.touch.OverScroll;
-import com.android.launcher3.util.Themes;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
@@ -87,8 +86,6 @@
     public static final int INVALID_RESTORE_PAGE = -1001;
 
     private boolean mFreeScroll = false;
-    private int mFreeScrollMinScrollX = -1;
-    private int mFreeScrollMaxScrollX = -1;
 
     protected int mFlingThresholdVelocity;
     protected int mMinFlingVelocity;
@@ -137,7 +134,6 @@
     protected int mTouchSlop;
     private int mMaximumVelocity;
     protected boolean mAllowOverScroll = true;
-    protected int[] mTempVisiblePagesRange = new int[2];
 
     protected static final int INVALID_POINTER = -1;
 
@@ -380,16 +376,8 @@
     }
 
     private int validateNewPage(int newPage) {
-        int validatedPage = newPage;
-        // When in free scroll mode, we need to clamp to the free scroll page range.
-        if (mFreeScroll) {
-            getFreeScrollPageRange(mTempVisiblePagesRange);
-            validatedPage = Math.max(mTempVisiblePagesRange[0],
-                    Math.min(newPage, mTempVisiblePagesRange[1]));
-        }
         // Ensure that it is clamped by the actual set of children in all cases
-        validatedPage = Utilities.boundToRange(validatedPage, 0, getPageCount() - 1);
-        return validatedPage;
+        return Utilities.boundToRange(newPage, 0, getPageCount() - 1);
     }
 
     /**
@@ -491,13 +479,11 @@
         if (mFreeScroll) {
             // If the scroller is trying to move to a location beyond the maximum allowed
             // in the free scroll mode, we make sure to end the scroll operation.
-            if (!mScroller.isFinished() &&
-                    (x > mFreeScrollMaxScrollX || x < mFreeScrollMinScrollX)) {
+            if (!mScroller.isFinished() && (x > mMaxScrollX || x < 0)) {
                 forceFinishScroller(false);
             }
 
-            x = Math.min(x, mFreeScrollMaxScrollX);
-            x = Math.max(x, mFreeScrollMinScrollX);
+            x = Utilities.boundToRange(x, 0, mMaxScrollX);
         }
 
         mUnboundedScrollX = x;
@@ -886,7 +872,7 @@
         return 0;
     }
 
-    @Thunk void updateMaxScrollX() {
+    private void updateMaxScrollX() {
         mMaxScrollX = computeMaxScrollX();
     }
 
@@ -915,13 +901,11 @@
 
         // This ensures that when children are added, they get the correct transforms / alphas
         // in accordance with any scroll effects.
-        updateFreescrollBounds();
         invalidate();
     }
 
     @Override
     public void onChildViewRemoved(View parent, View child) {
-        updateFreescrollBounds();
         mCurrentPage = validateNewPage(mCurrentPage);
         invalidate();
     }
@@ -974,11 +958,6 @@
         return offset;
     }
 
-    protected void getFreeScrollPageRange(int[] range) {
-        range[0] = 0;
-        range[1] = Math.max(0, getChildCount() - 1);
-    }
-
     @Override
     public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
         int page = indexToPage(indexOfChild(child));
@@ -1349,29 +1328,12 @@
         setEnableFreeScroll(false);
     }
 
-    void updateFreescrollBounds() {
-        getFreeScrollPageRange(mTempVisiblePagesRange);
-        if (mIsRtl) {
-            mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
-            mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
-        } else {
-            mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
-            mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
-        }
-    }
-
     private void setEnableFreeScroll(boolean freeScroll) {
         boolean wasFreeScroll = mFreeScroll;
         mFreeScroll = freeScroll;
 
         if (mFreeScroll) {
-            updateFreescrollBounds();
-            getFreeScrollPageRange(mTempVisiblePagesRange);
-            if (getCurrentPage() < mTempVisiblePagesRange[0]) {
-                setCurrentPage(mTempVisiblePagesRange[0]);
-            } else if (getCurrentPage() > mTempVisiblePagesRange[1]) {
-                setCurrentPage(mTempVisiblePagesRange[1]);
-            }
+            setCurrentPage(getNextPage());
         } else if (wasFreeScroll) {
             snapToPage(getNextPage());
         }
@@ -1387,12 +1349,12 @@
         if (mDragView != null) {
             int dragX = (int) (mDragView.getLeft() + (mDragView.getMeasuredWidth() / 2)
                     + mDragView.getTranslationX());
-            getFreeScrollPageRange(mTempVisiblePagesRange);
             int minDistance = Integer.MAX_VALUE;
             int minIndex = indexOfChild(mDragView);
-            for (int i = mTempVisiblePagesRange[0]; i <= mTempVisiblePagesRange[1]; i++) {
+            int maxPageNo = getChildCount() - 1;
+            for (int i = 0; i <= maxPageNo; i++) {
                 View page = getPageAt(i);
-                int pageX = (int) (page.getLeft() + page.getMeasuredWidth() / 2);
+                int pageX = (page.getLeft() + page.getMeasuredWidth() / 2);
                 int d = Math.abs(dragX - pageX);
                 if (d < minDistance) {
                     minIndex = i;
@@ -1487,11 +1449,7 @@
                 final int pageUnderPointIndex = getNearestHoverOverPageIndex();
                 // Do not allow any page to be moved to 0th position.
                 if (pageUnderPointIndex > 0 && pageUnderPointIndex != indexOfChild(mDragView)) {
-                    mTempVisiblePagesRange[0] = 0;
-                    mTempVisiblePagesRange[1] = getPageCount() - 1;
-                    getFreeScrollPageRange(mTempVisiblePagesRange);
-                    if (mTempVisiblePagesRange[0] <= pageUnderPointIndex &&
-                            pageUnderPointIndex <= mTempVisiblePagesRange[1] &&
+                    if (0 <= pageUnderPointIndex && pageUnderPointIndex <= getPageCount() - 1 &&
                             pageUnderPointIndex != mSidePageHoverIndex && mScroller.isFinished()) {
                         mSidePageHoverIndex = pageUnderPointIndex;
                         mSidePageHoverRunnable = new Runnable() {
@@ -2025,18 +1983,14 @@
         // Do not allow the first page to be moved around
         if (mTouchState != TOUCH_STATE_REST || dragViewIndex <= 0) return false;
 
-        mTempVisiblePagesRange[0] = 0;
-        mTempVisiblePagesRange[1] = getPageCount() - 1;
-        getFreeScrollPageRange(mTempVisiblePagesRange);
-        mReorderingStarted = true;
-
         // Check if we are within the reordering range
-        if (mTempVisiblePagesRange[0] <= dragViewIndex &&
-            dragViewIndex <= mTempVisiblePagesRange[1]) {
+        if (0 <= dragViewIndex && dragViewIndex <= getPageCount() - 1) {
             // Find the drag view under the pointer
             mDragView = getChildAt(dragViewIndex);
             mDragView.animate().scaleX(1.15f).scaleY(1.15f).setDuration(100).start();
             mDragViewBaselineLeft = mDragView.getLeft();
+            mReorderingStarted = true;
+
             snapToPage(getPageNearestToCenterOfScreen());
             disableFreeScroll();
             onStartReordering();
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 173ff6d..27d860b 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -54,8 +54,6 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
-import android.view.accessibility.AccessibilityManager;
-import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.DecelerateInterpolator;
 import android.view.animation.Interpolator;
 import android.widget.Toast;
@@ -576,6 +574,7 @@
         mWorkspaceScreens.put(screenId, newScreen);
         mScreenOrder.add(insertIndex, screenId);
         addView(newScreen, insertIndex);
+        mStateTransitionAnimation.applyChildState(mState, newScreen, insertIndex);
 
         if (mLauncher.getAccessibilityDelegate().isInAccessibleDrag()) {
             newScreen.enableAccessibleDrag(true, CellLayout.WORKSPACE_ACCESSIBILITY_DRAG);
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index d66255b..ff653d7 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -178,9 +178,6 @@
      * Starts a transition animation for the workspace.
      */
     private void setWorkspaceProperty(LauncherState state, PropertySetter propertySetter) {
-        // Update the workspace state
-        int finalBackgroundAlpha = state.hasScrim ? 255 : 0;
-
         float[] scaleAndTranslationY = state.getWorkspaceScaleAndTranslation(mLauncher);
         mNewScale = scaleAndTranslationY[0];
         final float finalWorkspaceTranslationY = scaleAndTranslationY[1];
@@ -188,16 +185,8 @@
         int toPage = mWorkspace.getPageNearestToCenterOfScreen();
         final int childCount = mWorkspace.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            final CellLayout cl = (CellLayout) mWorkspace.getChildAt(i);
-            propertySetter.setInt(cl.getScrimBackground(),
-                    DRAWABLE_ALPHA, finalBackgroundAlpha, mZoomInInterpolator);
-
-            // Only animate the page alpha when we actually fade pages
-            if (mWorkspaceFadeInAdjacentScreens) {
-                float finalAlpha = state == LauncherState.NORMAL && i != toPage ? 0 : 1f;
-                propertySetter.setFloat(cl.getShortcutsAndWidgets(), View.ALPHA,
-                        finalAlpha, mZoomInInterpolator);
-            }
+            applyChildState(state, (CellLayout) mWorkspace.getChildAt(i), i, toPage,
+                    propertySetter);
         }
 
         float finalHotseatAlpha = state.hideHotseat ? 0f : 1f;
@@ -217,6 +206,24 @@
                 state.hasScrim ? mWorkspaceScrimAlpha : 0, new DecelerateInterpolator(1.5f));
     }
 
+    public void applyChildState(LauncherState state, CellLayout cl, int childIndex) {
+        applyChildState(state, cl, childIndex, mWorkspace.getPageNearestToCenterOfScreen(),
+                NO_ANIM_PROPERTY_SETTER);
+    }
+
+    private void applyChildState(LauncherState state, CellLayout cl, int childIndex,
+            int centerPage, PropertySetter propertySetter) {
+        propertySetter.setInt(cl.getScrimBackground(),
+                DRAWABLE_ALPHA, state.hasScrim ? 255 : 0, mZoomInInterpolator);
+
+        // Only animate the page alpha when we actually fade pages
+        if (mWorkspaceFadeInAdjacentScreens) {
+            float finalAlpha = state == LauncherState.NORMAL && childIndex != centerPage ? 0 : 1f;
+            propertySetter.setFloat(cl.getShortcutsAndWidgets(), View.ALPHA,
+                    finalAlpha, mZoomInInterpolator);
+        }
+    }
+
     private static class PropertySetter {
 
         public void setViewAlpha(Animator anim, View view, float alpha) {
diff --git a/src/com/android/launcher3/states/OverviewState.java b/src/com/android/launcher3/states/OverviewState.java
index 57f023c..344a4f9 100644
--- a/src/com/android/launcher3/states/OverviewState.java
+++ b/src/com/android/launcher3/states/OverviewState.java
@@ -36,8 +36,7 @@
     // The percent to shrink the workspace during overview mode
     public static final float SCALE_FACTOR = 0.7f;
 
-    private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_HIDE_HOTSEAT |
-            FLAG_DO_NOT_RESTORE;
+    private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE | FLAG_HIDE_HOTSEAT;
 
     public OverviewState(int id) {
         super(id, ContainerType.WORKSPACE, OVERVIEW_TRANSITION_MS, 1f, STATE_FLAGS);
