Fix and merge of unittest