Added a couple of tests and fixed a bug, the tests should be re-written to make more sense