Fixed tests build path, and test code.

There is still one test that seems incorrect.