Bug 12168: fix spent and ordered budget values are wrong when depth >= 2