mock criteria fix, also unit test fixes