Fix bug in labelswitching

Issue when no appropriate candidates found. fixed by permuting labels of
non-empty groups in iter and testing all (much faster than testing 1:K)