Added a few more tests and fixes