I fixed this and added some more tests.