Adding some more tests and cleaning up a bit