Fix bug for inserts to 0-length sets

All items were inserted via a sorted insert, which did at least one comparison. For inserts into an empty set, this meant a comparison to undefined. This fix addresses the special case.