added more tests

also fixed the bugs found. Good thing, these tests.