Correct failing tests

This applies a bunch of simple fixes to make the tests pass. Merging this closes #12.