Merge "Fix two bugs in external storage accounting."
am: d1361ceb0c

Change-Id: I6f661104fbe8527bfbb1f9599beb395e5bc9d218