Properly remove from YAML sets

Also clean the resulting YAML file from empty maps