WIP #32. Still needs more tests.