fix build + added tests