Finish all the tests Closing #33.
Bugfixes from the tests.