Fix bug with empty collection.