diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index 9369cbe..091971e 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -201,6 +201,11 @@
     private ViewGroup mAnimationViewGroup;
     private LinearLayout mBadgeContainer;
     private final List<ImageView> mBadges;
+    /**
+     * List to hold the separators. This saves us from reconstructing every expand/collapse and
+     * provides a smoother animation.
+     */
+    private List<View> mSeparators;
     private LinearLayout mContainer;
 
     private final OnClickListener mExpandCollapseButtonListener = new OnClickListener() {
@@ -259,6 +264,10 @@
             mEntryViews.add(new ArrayList<View>());
         }
         mCollapsedEntriesCount = Math.min(numInitialVisibleEntries, mNumEntries);
+        // We need a separator between each list, but not after the last one
+        if (entries.size() > 1) {
+            mSeparators = new ArrayList<>(entries.size() - 1);
+        }
         mListener = listener;
         mAnimationViewGroup = animationViewGroup;
 
@@ -311,9 +320,17 @@
         mEntriesViewGroup.removeAllViews();
 
         if (mIsExpanded) {
-            for (List<View> viewList : mEntryViews) {
-                if (viewList != mEntryViews.get(0)) {
-                    addSeparator(viewList.get(0));
+            for (int i = 0; i < mEntryViews.size(); i++) {
+                List<View> viewList = mEntryViews.get(i);
+                if (i > 0) {
+                    View separator;
+                    if (mSeparators.size() <= i - 1) {
+                        separator = generateSeparator(viewList.get(0));
+                        mSeparators.add(separator);
+                    } else {
+                        separator = mSeparators.get(i - 1);
+                    }
+                    mEntriesViewGroup.addView(separator);
                 }
                 for (View view : viewList) {
                     addEntry(view);
@@ -329,7 +346,14 @@
                     i++) {
                 List<View> entryViewList = mEntryViews.get(i);
                 if (i > 0) {
-                    addSeparator(entryViewList.get(0));
+                    View separator;
+                    if (mSeparators.size() <= i - 1) {
+                        separator = generateSeparator(entryViewList.get(0));
+                        mSeparators.add(separator);
+                    } else {
+                        separator = mSeparators.get(i - 1);
+                    }
+                    mEntriesViewGroup.addView(separator);
                 }
                 addEntry(entryViewList.get(0));
                 numInViewGroup++;
@@ -367,7 +391,7 @@
         mEntriesViewGroup.addView(entry);
     }
 
-    private void addSeparator(View entry) {
+    private View generateSeparator(View entry) {
         View separator = new View(getContext());
         Resources res = getResources();
 
@@ -389,7 +413,7 @@
         }
         layoutParams.setMarginStart(marginStart);
         separator.setLayoutParams(layoutParams);
-        mEntriesViewGroup.addView(separator);
+        return separator;
     }
 
     private CharSequence getExpandButtonText() {
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 9bcdde8..50e4ff7 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -953,12 +953,14 @@
             mAboutCard.setTitle(customAboutCardName);
         }
 
-        mAboutCard.initialize(aboutCardEntries,
-                /* numInitialVisibleEntries = */ 1,
-                /* isExpanded = */ true,
-                /* isAlwaysExpanded = */ true,
-                mExpandingEntryCardViewListener,
-                mScroller);
+        if (aboutCardEntries.size() > 0) {
+            mAboutCard.initialize(aboutCardEntries,
+                    /* numInitialVisibleEntries = */ 1,
+                    /* isExpanded = */ true,
+                    /* isAlwaysExpanded = */ true,
+                    mExpandingEntryCardViewListener,
+                    mScroller);
+        }
 
         if (contactCardEntries.size() == 0 && aboutCardEntries.size() == 0) {
             initializeNoContactDetailCard();
