Fix build and add more tests