Tests are broken
Fix the code and add some more tests