Fixing common unit test issues