Added special case for empty sets