Remove debug code
Add a couple of tests