Throwing out error when given collection is empty. Related to #22