sort out sv.cmp zz (and correct unit tests)