Hide empty collections (bug 1017848)

The relevant change is here :)