Fixed some things. Added more tests.