Support loading empty collections

Fixes #337