diff --git a/src/com/android/contacts/GroupMemberLoader.java b/src/com/android/contacts/GroupMemberLoader.java
deleted file mode 100644
index 8bc7d04..0000000
--- a/src/com/android/contacts/GroupMemberLoader.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-package com.android.contacts;
-
-import android.content.Context;
-import android.content.CursorLoader;
-import android.net.Uri;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
-import android.provider.ContactsContract.Contacts;
-import android.provider.ContactsContract.Data;
-import android.provider.ContactsContract.Directory;
-
-import com.android.contacts.common.preference.ContactsPreferences;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Group Member loader. Loads all group members from the given groupId
- */
-public final class GroupMemberLoader extends CursorLoader {
-
-    public static class GroupEditorQuery {
-        private static final String[] PROJECTION = new String[] {
-            Data.CONTACT_ID,                        // 0
-            Data.RAW_CONTACT_ID,                    // 1
-            Data.DISPLAY_NAME_PRIMARY,              // 2
-            Data.PHOTO_URI,                         // 3
-            Data.LOOKUP_KEY,                        // 4
-            Data.PHOTO_ID,                          // 5
-        };
-
-        public static final int CONTACT_ID                   = 0;
-        public static final int RAW_CONTACT_ID               = 1;
-        public static final int CONTACT_DISPLAY_NAME_PRIMARY = 2;
-        public static final int CONTACT_PHOTO_URI            = 3;
-        public static final int CONTACT_LOOKUP_KEY           = 4;
-        public static final int CONTACT_PHOTO_ID             = 5;
-    }
-
-    private final long mGroupId;
-
-    private GroupMemberLoader(Context context, long groupId, String[] projection) {
-        super(context);
-        mGroupId = groupId;
-        setUri(createUri());
-        setProjection(projection);
-        setSelection(createSelection());
-        setSelectionArgs(createSelectionArgs());
-
-        ContactsPreferences prefs = new ContactsPreferences(context);
-        if (prefs.getSortOrder() == ContactsPreferences.SORT_ORDER_PRIMARY) {
-            setSortOrder(Contacts.SORT_KEY_PRIMARY);
-        } else {
-            setSortOrder(Contacts.SORT_KEY_ALTERNATIVE);
-        }
-    }
-
-    private Uri createUri() {
-        Uri uri = Data.CONTENT_URI;
-        uri = uri.buildUpon().appendQueryParameter(ContactsContract.DIRECTORY_PARAM_KEY,
-                String.valueOf(Directory.DEFAULT)).build();
-        return uri;
-    }
-
-    private String createSelection() {
-        StringBuilder selection = new StringBuilder();
-        selection.append(Data.MIMETYPE + "=?" + " AND " + GroupMembership.GROUP_ROW_ID + "=?");
-        return selection.toString();
-    }
-
-    private String[] createSelectionArgs() {
-        List<String> selectionArgs = new ArrayList<String>();
-        selectionArgs.add(GroupMembership.CONTENT_ITEM_TYPE);
-        selectionArgs.add(String.valueOf(mGroupId));
-        return selectionArgs.toArray(new String[0]);
-    }
-}
diff --git a/src/com/android/contacts/group/GroupMembersFragment.java b/src/com/android/contacts/group/GroupMembersFragment.java
index bdb246a..c65bf49 100644
--- a/src/com/android/contacts/group/GroupMembersFragment.java
+++ b/src/com/android/contacts/group/GroupMembersFragment.java
@@ -198,13 +198,10 @@
     }
 
     public GroupMembersFragment() {
-        setHasOptionsMenu(true);
-
         setPhotoLoaderEnabled(true);
         setSectionHeaderDisplayEnabled(true);
-        // Don't show the scrollbar until after group members have been loaded
-        setVisibleScrollbarEnabled(false);
-        setQuickContactEnabled(false);
+        setHasOptionsMenu(true);
+
         setListType(ListType.GROUP);
     }
 
@@ -243,6 +240,9 @@
     @Override
     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
         if (data != null) {
+            // Wait until contacts are loaded before showing the scrollbar
+            setVisibleScrollbarEnabled(true);
+
             final FilterCursorWrapper cursorWrapper = new FilterCursorWrapper(data);
             bindMembersCount(cursorWrapper.getCount());
             super.onLoadFinished(loader, cursorWrapper);
@@ -299,6 +299,7 @@
     @Override
     protected GroupMembersAdapter createListAdapter() {
         final GroupMembersAdapter adapter = new GroupMembersAdapter(getContext());
+        adapter.setSectionHeaderDisplayEnabled(true);
         adapter.setDisplayPhotos(true);
         return adapter;
     }
diff --git a/src/com/android/contacts/list/GroupMemberPickerFragment.java b/src/com/android/contacts/list/GroupMemberPickerFragment.java
index de856a4..d7ad9ed 100644
--- a/src/com/android/contacts/list/GroupMemberPickerFragment.java
+++ b/src/com/android/contacts/list/GroupMemberPickerFragment.java
@@ -153,9 +153,7 @@
 
     public GroupMemberPickerFragment() {
         setPhotoLoaderEnabled(true);
-        setSectionHeaderDisplayEnabled(false);
-        setVisibleScrollbarEnabled(true);
-
+        setSectionHeaderDisplayEnabled(true);
         setHasOptionsMenu(true);
     }
 
@@ -196,6 +194,9 @@
     @Override
     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
         if (data != null) {
+            // Wait until contacts are loaded before showing the scrollbar
+            setVisibleScrollbarEnabled(true);
+
             super.onLoadFinished(loader, new FilterCursorWrapper(data));
         }
     }
