Add extensive unittest [fixup]