Fix SET splitting function