Add tests, and fix bugs found from those tests
0.1.0