Add test: prepare unit
Some fix in tests