Bugfix/storage calc on deleted buckets develop

Cherry-picked #995 and #996 .