Actually run all tests; fix some bugs

Fixes #418.