fix build, add tests.