fixed bug when gen ref test sets