Fix tests and add a few more tests