compatibility issues and fixes to extend to all types of sets