Get the build running For Realz

Changed some mocking to make it more reliable in tests.