diff --git a/DirectVolume.h b/DirectVolume.h
index de1ed8b..c0139d4 100644
--- a/DirectVolume.h
+++ b/DirectVolume.h
@@ -27,7 +27,7 @@
 
 class DirectVolume : public Volume {
 public:
-    static const int MAX_PARTITIONS = 4;
+    static const int MAX_PARTITIONS = 32;
 protected:
     PathCollection *mPaths;
     int            mDiskMajor;
@@ -37,7 +37,7 @@
     int            mOrigDiskMinor;
     int            mOrigPartMinors[MAX_PARTITIONS];
     int            mDiskNumParts;
-    unsigned char  mPendingPartMap;
+    unsigned int   mPendingPartMap;
     int            mIsDecrypted;
     int            mFlags;
 
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 9867bbb..f2e2d07 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -986,6 +986,19 @@
     return 0;
 }
 
+Volume* VolumeManager::getVolumeForFile(const char *fileName) {
+    VolumeCollection::iterator i;
+
+    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
+        const char* mountPoint = (*i)->getMountpoint();
+        if (!strncmp(fileName, mountPoint, strlen(mountPoint))) {
+            return *i;
+        }
+    }
+
+    return NULL;
+}
+
 /**
  * Mounts an image file <code>img</code>.
  */
@@ -1114,7 +1127,7 @@
     }
 
     // Create a string to compare against that has a trailing slash
-    int loopDirLen = sizeof(Volume::LOOPDIR);
+    int loopDirLen = strlen(Volume::LOOPDIR);
     char loopDir[loopDirLen + 2];
     strcpy(loopDir, Volume::LOOPDIR);
     loopDir[loopDirLen++] = '/';
@@ -1463,25 +1476,35 @@
 }
 
 int VolumeManager::cleanupAsec(Volume *v, bool force) {
-    while(mActiveContainers->size()) {
-        AsecIdCollection::iterator it = mActiveContainers->begin();
+    int rc = unmountAllAsecsInDir(Volume::SEC_ASECDIR_EXT);
+
+    AsecIdCollection toUnmount;
+    // Find the remaining OBB files that are on external storage.
+    for (AsecIdCollection::iterator it = mActiveContainers->begin(); it != mActiveContainers->end();
+            ++it) {
         ContainerData* cd = *it;
-        SLOGI("Unmounting ASEC %s (dependant on %s)", cd->id, v->getMountpoint());
+
         if (cd->type == ASEC) {
-            if (unmountAsec(cd->id, force)) {
-                SLOGE("Failed to unmount ASEC %s (%s)", cd->id, strerror(errno));
-                return -1;
-            }
+            // nothing
         } else if (cd->type == OBB) {
-            if (unmountObb(cd->id, force)) {
-                SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno));
-                return -1;
+            if (v == getVolumeForFile(cd->id)) {
+                toUnmount.push_back(cd);
             }
         } else {
             SLOGE("Unknown container type %d!", cd->type);
-            return -1;
         }
     }
-    return 0;
+
+    for (AsecIdCollection::iterator it = toUnmount.begin(); it != toUnmount.end(); ++it) {
+        ContainerData *cd = *it;
+        SLOGI("Unmounting ASEC %s (dependant on %s)", cd->id, v->getMountpoint());
+        if (unmountObb(cd->id, force)) {
+            SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno));
+            rc = -1;
+        }
+    }
+
+    return rc;
+
 }
 
diff --git a/VolumeManager.h b/VolumeManager.h
index 4399b76..198b5a9 100644
--- a/VolumeManager.h
+++ b/VolumeManager.h
@@ -117,6 +117,8 @@
     int unmountObb(const char *fileName, bool force);
     int getObbMountPath(const char *id, char *buffer, int maxlen);
 
+    Volume* getVolumeForFile(const char *fileName);
+
     /* Shared between ASEC and Loopback images */
     int unmountLoopImage(const char *containerId, const char *loopId,
             const char *fileName, const char *mountPoint, bool force);
