Merge "Fix two bugs in external storage accounting."