getAll returns empty object when directory has no objects (refs #597)

There was still one case where `getAll` returns undefined instead of an empty object, that we didn't catch in #674.