This PR fixes the build and adds tests.