Repair logic in unittests - pass