Adding more tests, fixing more issues